#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 *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
long timegm(struct tm *);
int /*<<< orphan*/ zstr_tolower(char *);
long zmime_header_line_decode_date(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));
  strncpy(str_copy, str, 127);
  str_copy[127] = 0;
  zstr_tolower(str_copy);
  for (p = str_copy; *p; p++) {
    if (*p == '-') {
      *p = ' ';
    }
  }
  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_line_decode_date>:
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   1050 <memset@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x7f,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x90(%rbp),%rdi
call   1070 <zstr_tolower@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
je     1209 <zmime_header_line_decode_date+0xa9>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11ed <zmime_header_line_decode_date+0x8d>
mov    -0xa0(%rbp),%rax
movb   $0x20,(%rax)
jmp    11f2 <zmime_header_line_decode_date+0x92>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    11c0 <zmime_header_line_decode_date+0x60>
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     126f <zmime_header_line_decode_date+0x10f>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0xfa(%rbp)
jl     1263 <zmime_header_line_decode_date+0x103>
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    1282 <zmime_header_line_decode_date+0x122>
jmp    1299 <zmime_header_line_decode_date+0x139>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1217 <zmime_header_line_decode_date+0xb7>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12ae <zmime_header_line_decode_date+0x14e>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     12ed <zmime_header_line_decode_date+0x18d>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xfb(%rbp)
mov    -0xfb(%rbp),%al
test   $0x1,%al
jne    1300 <zmime_header_line_decode_date+0x1a0>
jmp    1317 <zmime_header_line_decode_date+0x1b7>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    12bc <zmime_header_line_decode_date+0x15c>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    132c <zmime_header_line_decode_date+0x1cc>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     1388 <zmime_header_line_decode_date+0x228>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0xfc(%rbp)
mov    -0xfc(%rbp),%al
test   $0x1,%al
jne    139b <zmime_header_line_decode_date+0x23b>
jmp    13b2 <zmime_header_line_decode_date+0x252>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1357 <zmime_header_line_decode_date+0x1f7>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    13c7 <zmime_header_line_decode_date+0x267>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     1406 <zmime_header_line_decode_date+0x2a6>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xfd(%rbp)
mov    -0xfd(%rbp),%al
test   $0x1,%al
jne    1419 <zmime_header_line_decode_date+0x2b9>
jmp    1430 <zmime_header_line_decode_date+0x2d0>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    13d5 <zmime_header_line_decode_date+0x275>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1445 <zmime_header_line_decode_date+0x2e5>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
mov    -0xa0(%rbp),%rax
mov    -0x98(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x3,%rax
je     1465 <zmime_header_line_decode_date+0x305>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     15e1 <zmime_header_line_decode_date+0x481>
mov    -0x108(%rbp),%rax
lea    0xb28(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x70,%eax
jne    1503 <zmime_header_line_decode_date+0x3a3>
movl   $0x3,-0xb4(%rbp)
jmp    150d <zmime_header_line_decode_date+0x3ad>
movl   $0x7,-0xb4(%rbp)
jmp    15e1 <zmime_header_line_decode_date+0x481>
movl   $0xb,-0xb4(%rbp)
jmp    15e1 <zmime_header_line_decode_date+0x481>
movl   $0x1,-0xb4(%rbp)
jmp    15e1 <zmime_header_line_decode_date+0x481>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jne    1552 <zmime_header_line_decode_date+0x3f2>
movl   $0x0,-0xb4(%rbp)
jmp    1583 <zmime_header_line_decode_date+0x423>
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    1574 <zmime_header_line_decode_date+0x414>
movl   $0x5,-0xb4(%rbp)
jmp    157e <zmime_header_line_decode_date+0x41e>
movl   $0x6,-0xb4(%rbp)
jmp    1583 <zmime_header_line_decode_date+0x423>
jmp    15e1 <zmime_header_line_decode_date+0x481>
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    15aa <zmime_header_line_decode_date+0x44a>
movl   $0x2,-0xb4(%rbp)
jmp    15b4 <zmime_header_line_decode_date+0x454>
movl   $0x4,-0xb4(%rbp)
jmp    15e1 <zmime_header_line_decode_date+0x481>
movl   $0xa,-0xb4(%rbp)
jmp    15e1 <zmime_header_line_decode_date+0x481>
movl   $0x9,-0xb4(%rbp)
jmp    15e1 <zmime_header_line_decode_date+0x481>
movl   $0x8,-0xb4(%rbp)
cmpl   $0xffffffff,-0xb4(%rbp)
jne    15f3 <zmime_header_line_decode_date+0x493>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     1630 <zmime_header_line_decode_date+0x4d0>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%al
test   $0x1,%al
jne    1643 <zmime_header_line_decode_date+0x4e3>
jmp    165a <zmime_header_line_decode_date+0x4fa>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    15ff <zmime_header_line_decode_date+0x49f>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    166f <zmime_header_line_decode_date+0x50f>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     16ae <zmime_header_line_decode_date+0x54e>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x10a(%rbp)
mov    -0x10a(%rbp),%al
test   $0x1,%al
jne    16c1 <zmime_header_line_decode_date+0x561>
jmp    16d8 <zmime_header_line_decode_date+0x578>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    167d <zmime_header_line_decode_date+0x51d>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    16ed <zmime_header_line_decode_date+0x58d>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
mov    -0xa0(%rbp),%rax
mov    -0x98(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x4,%rax
je     170d <zmime_header_line_decode_date+0x5ad>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     176f <zmime_header_line_decode_date+0x60f>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x10b(%rbp)
mov    -0x10b(%rbp),%al
test   $0x1,%al
jne    1782 <zmime_header_line_decode_date+0x622>
jmp    1799 <zmime_header_line_decode_date+0x639>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    173e <zmime_header_line_decode_date+0x5de>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    17ae <zmime_header_line_decode_date+0x64e>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     17ed <zmime_header_line_decode_date+0x68d>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x10c(%rbp)
mov    -0x10c(%rbp),%al
test   $0x1,%al
jne    1800 <zmime_header_line_decode_date+0x6a0>
jmp    1817 <zmime_header_line_decode_date+0x6b7>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    17bc <zmime_header_line_decode_date+0x65c>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    182c <zmime_header_line_decode_date+0x6cc>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     1896 <zmime_header_line_decode_date+0x736>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x10d(%rbp)
mov    -0x10d(%rbp),%al
test   $0x1,%al
jne    18a9 <zmime_header_line_decode_date+0x749>
jmp    18c0 <zmime_header_line_decode_date+0x760>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1865 <zmime_header_line_decode_date+0x705>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    18d5 <zmime_header_line_decode_date+0x775>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     193f <zmime_header_line_decode_date+0x7df>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x10e(%rbp)
mov    -0x10e(%rbp),%al
test   $0x1,%al
jne    1952 <zmime_header_line_decode_date+0x7f2>
jmp    1969 <zmime_header_line_decode_date+0x809>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    190e <zmime_header_line_decode_date+0x7ae>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    197e <zmime_header_line_decode_date+0x81e>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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     19da <zmime_header_line_decode_date+0x87a>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x10f(%rbp)
mov    -0x10f(%rbp),%al
test   $0x1,%al
jne    19ed <zmime_header_line_decode_date+0x88d>
jmp    1a04 <zmime_header_line_decode_date+0x8a4>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    19a9 <zmime_header_line_decode_date+0x849>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1a19 <zmime_header_line_decode_date+0x8b9>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x5,%eax
jge    1a41 <zmime_header_line_decode_date+0x8e1>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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    1b0d <zmime_header_line_decode_date+0x9ad>
jmp    1b2e <zmime_header_line_decode_date+0x9ce>
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_line_decode_date>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,%r14
lea    0x30(%rsp),%rbx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7f,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xaf(%rsp)
mov    %rbx,%rdi
call   1070 <zstr_tolower@plt>
jmp    11b7 <zmime_header_line_decode_date+0x57>
nopw   0x0(%rax,%rax,1)
movb   $0x20,(%rbx)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x2d,%al
je     11b0 <zmime_header_line_decode_date+0x50>
test   %al,%al
jne    11b3 <zmime_header_line_decode_date+0x53>
mov    0x30(%rsp),%al
mov    $0xffffffffffffffff,%r14
test   %al,%al
je     1381 <zmime_header_line_decode_date+0x221>
lea    0x31(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
lea    -0x3a(%rax),%ecx
cmp    $0xf6,%cl
jae    11f8 <zmime_header_line_decode_date+0x98>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11e0 <zmime_header_line_decode_date+0x80>
jmp    1381 <zmime_header_line_decode_date+0x221>
lea    -0x1(%rbx),%rdi
test   %al,%al
je     1381 <zmime_header_line_decode_date+0x221>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x20,%al
je     1224 <zmime_header_line_decode_date+0xc4>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1210 <zmime_header_line_decode_date+0xb0>
jmp    1381 <zmime_header_line_decode_date+0x221>
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     1240 <zmime_header_line_decode_date+0xe0>
test   %cl,%cl
je     1381 <zmime_header_line_decode_date+0x221>
mov    $0x3,%edx
mov    %rbx,%rax
test   $0xdf,%cl
je     1280 <zmime_header_line_decode_date+0x120>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
test   $0xdf,%cl
jne    1270 <zmime_header_line_decode_date+0x110>
test   %cl,%cl
je     1381 <zmime_header_line_decode_date+0x221>
test   %rdx,%rdx
jne    1381 <zmime_header_line_decode_date+0x221>
movb   $0x0,-0x1(%rax)
movsbl -0x1(%rbx),%edx
add    $0xffffff9f,%edx
cmp    $0x12,%edx
ja     1381 <zmime_header_line_decode_date+0x221>
mov    $0xb,%ecx
lea    0xd4f(%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    1310 <zmime_header_line_decode_date+0x1b0>
mov    $0x1,%ecx
jmp    1310 <zmime_header_line_decode_date+0x1b0>
xor    %ecx,%ecx
cmpb   $0x61,0x1(%rax)
je     1310 <zmime_header_line_decode_date+0x1b0>
xor    %edx,%edx
cmpb   $0x6e,0x2(%rax)
sete   %dl
mov    $0x6,%ecx
sub    %edx,%ecx
jmp    1310 <zmime_header_line_decode_date+0x1b0>
xor    %ecx,%ecx
cmpb   $0x72,0x2(%rax)
setne  %cl
add    %ecx,%ecx
add    $0x2,%ecx
jmp    1310 <zmime_header_line_decode_date+0x1b0>
mov    $0xa,%ecx
jmp    1310 <zmime_header_line_decode_date+0x1b0>
mov    $0x9,%ecx
jmp    1310 <zmime_header_line_decode_date+0x1b0>
mov    $0x8,%ecx
mov    %ecx,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
je     1320 <zmime_header_line_decode_date+0x1c0>
test   %cl,%cl
je     1381 <zmime_header_line_decode_date+0x221>
lea    -0x1(%rax),%rdi
xor    %edx,%edx
test   $0xdf,%cl
je     134d <zmime_header_line_decode_date+0x1ed>
nopl   0x0(%rax,%rax,1)
movzbl (%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   $0xdf,%cl
jne    1340 <zmime_header_line_decode_date+0x1e0>
test   %cl,%cl
je     1381 <zmime_header_line_decode_date+0x221>
cmp    $0x4,%rdx
jne    1381 <zmime_header_line_decode_date+0x221>
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     1372 <zmime_header_line_decode_date+0x212>
test   %al,%al
jne    1396 <zmime_header_line_decode_date+0x236>
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     1381 <zmime_header_line_decode_date+0x221>
cmp    $0x3a,%al
je     13b3 <zmime_header_line_decode_date+0x253>
movzbl (%r15),%eax
add    $0x1,%r15
test   %al,%al
jne    13a1 <zmime_header_line_decode_date+0x241>
jmp    1381 <zmime_header_line_decode_date+0x221>
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     1381 <zmime_header_line_decode_date+0x221>
cmp    $0x3a,%al
je     13db <zmime_header_line_decode_date+0x27b>
add    $0x1,%rbx
jmp    13c9 <zmime_header_line_decode_date+0x269>
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     1381 <zmime_header_line_decode_date+0x221>
cmp    $0x20,%al
je     1401 <zmime_header_line_decode_date+0x2a1>
add    $0x1,%r15
jmp    13ef <zmime_header_line_decode_date+0x28f>
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     1412 <zmime_header_line_decode_date+0x2b2>
test   %al,%al
je     1381 <zmime_header_line_decode_date+0x221>
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    $0x5,%eax
jl     1381 <zmime_header_line_decode_date+0x221>
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     1381 <zmime_header_line_decode_date+0x221>
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    1381 <zmime_header_line_decode_date+0x221>

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

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