#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 */
typedef int /*<<< orphan*/ tm;
typedef scalar_t__ time_t;
struct tm {
  int tm_mon;
  int tm_year;
  int tm_sec;
  void *tm_min;
  void *tm_hour;
  void *tm_mday;
};

/* Variables and functions */
int abs(int);
int atoi(char const *);
void *get_unsigned(char const **, int);
char *memchr(char const *, char, int);
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int strcspn(char const *, char *);
scalar_t__ time(int /*<<< orphan*/ *);
scalar_t__ timegm(struct tm *);
char tolower(int /*<<< orphan*/);
int rfc2822_parse_date(time_t *ret, const char *date, const char *end) {
  int i;
  struct tm tm;
  memset(&tm, 0, sizeof(tm));
  const char *s = memchr(date, ',', end - date);
  if (s)
    date = s + 1;
  tm.tm_mday = get_unsigned(&date, 2);
  char mon[3];
  for (i = 0; i < 3; ++i)
    mon[i] = tolower(*date++);
  if (mon[0] == 'j') {
    if (mon[1] == 'a')
      tm.tm_mon = 0;
    else if (mon[2] == 'n')
      tm.tm_mon = 5;
    else
      tm.tm_mon = 6;
  } else if (mon[0] == 'f')
    tm.tm_mon = 1;
  else if (mon[0] == 'm') {
    if (mon[2] == 'r')
      tm.tm_mon = 2;
    else
      tm.tm_mon = 4;
  } else if (mon[1] == 'p')
    tm.tm_mon = 3;
  else if (mon[0] == 'a')
    tm.tm_mon = 7;
  else if (mon[0] == 's')
    tm.tm_mon = 8;
  else if (mon[0] == 'o')
    tm.tm_mon = 9;
  else if (mon[0] == 'n')
    tm.tm_mon = 10;
  else
    tm.tm_mon = 11;
  tm.tm_year = get_unsigned(&date, 4);
  if (tm.tm_year > 1900)
    tm.tm_year -= 1900;
  if (tm.tm_year < 70)
    tm.tm_year += 100;
  tm.tm_hour = get_unsigned(&date, 2);
  if (*date++ != ':')
    return -1;
  tm.tm_min = get_unsigned(&date, 2);
  if (*date++ == ':')
    tm.tm_sec = get_unsigned(&date, 2);
  int tz_offset = strcspn(date, "-+");
  if (date[tz_offset]) {
    int offset = atoi(date + tz_offset);
    tm.tm_sec -= ((offset / 100) * 60 + abs(offset) % 100) * 60;
  }
  *ret = timegm(&tm);
  static time_t recently;
  if (*ret > recently) {
    recently = time(NULL);
    if (*ret > recently)
      *ret = recently;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rfc2822_parse_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    $0x2c,%esi
call   1060 <memchr@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     11ea <rfc2822_parse_date+0x5a>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   10b0 <get_unsigned@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    123c <rfc2822_parse_date+0xac>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1080 <tolower@plt>
mov    %al,%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x5b(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1203 <rfc2822_parse_date+0x73>
movsbl -0x5b(%rbp),%eax
cmp    $0x6a,%eax
jne    128c <rfc2822_parse_date+0xfc>
movsbl -0x5a(%rbp),%eax
cmp    $0x61,%eax
jne    1262 <rfc2822_parse_date+0xd2>
movl   $0x0,-0x50(%rbp)
jmp    1287 <rfc2822_parse_date+0xf7>
movsbl -0x59(%rbp),%eax
cmp    $0x6e,%eax
jne    127b <rfc2822_parse_date+0xeb>
movl   $0x5,-0x50(%rbp)
jmp    1282 <rfc2822_parse_date+0xf2>
movl   $0x6,-0x50(%rbp)
jmp    1287 <rfc2822_parse_date+0xf7>
jmp    137e <rfc2822_parse_date+0x1ee>
movsbl -0x5b(%rbp),%eax
cmp    $0x66,%eax
jne    12a5 <rfc2822_parse_date+0x115>
movl   $0x1,-0x50(%rbp)
jmp    1379 <rfc2822_parse_date+0x1e9>
movsbl -0x5b(%rbp),%eax
cmp    $0x6d,%eax
jne    12d7 <rfc2822_parse_date+0x147>
movsbl -0x59(%rbp),%eax
cmp    $0x72,%eax
jne    12cb <rfc2822_parse_date+0x13b>
movl   $0x2,-0x50(%rbp)
jmp    12d2 <rfc2822_parse_date+0x142>
movl   $0x4,-0x50(%rbp)
jmp    1374 <rfc2822_parse_date+0x1e4>
movsbl -0x5a(%rbp),%eax
cmp    $0x70,%eax
jne    12f0 <rfc2822_parse_date+0x160>
movl   $0x3,-0x50(%rbp)
jmp    136f <rfc2822_parse_date+0x1df>
movsbl -0x5b(%rbp),%eax
cmp    $0x61,%eax
jne    1309 <rfc2822_parse_date+0x179>
movl   $0x7,-0x50(%rbp)
jmp    136a <rfc2822_parse_date+0x1da>
movsbl -0x5b(%rbp),%eax
cmp    $0x73,%eax
jne    1322 <rfc2822_parse_date+0x192>
movl   $0x8,-0x50(%rbp)
jmp    1365 <rfc2822_parse_date+0x1d5>
movsbl -0x5b(%rbp),%eax
cmp    $0x6f,%eax
jne    133b <rfc2822_parse_date+0x1ab>
movl   $0x9,-0x50(%rbp)
jmp    1360 <rfc2822_parse_date+0x1d0>
movsbl -0x5b(%rbp),%eax
cmp    $0x6e,%eax
jne    1354 <rfc2822_parse_date+0x1c4>
movl   $0xa,-0x50(%rbp)
jmp    135b <rfc2822_parse_date+0x1cb>
movl   $0xb,-0x50(%rbp)
jmp    1360 <rfc2822_parse_date+0x1d0>
jmp    1365 <rfc2822_parse_date+0x1d5>
jmp    136a <rfc2822_parse_date+0x1da>
jmp    136f <rfc2822_parse_date+0x1df>
jmp    1374 <rfc2822_parse_date+0x1e4>
jmp    1379 <rfc2822_parse_date+0x1e9>
jmp    137e <rfc2822_parse_date+0x1ee>
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <get_unsigned@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x76c,-0x4c(%rbp)
jle    13a7 <rfc2822_parse_date+0x217>
mov    -0x4c(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x46,-0x4c(%rbp)
jge    13ba <rfc2822_parse_date+0x22a>
mov    -0x4c(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x4c(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   10b0 <get_unsigned@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     13f3 <rfc2822_parse_date+0x263>
movl   $0xffffffff,-0x4(%rbp)
jmp    14ff <rfc2822_parse_date+0x36f>
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   10b0 <get_unsigned@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1431 <rfc2822_parse_date+0x2a1>
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   10b0 <get_unsigned@plt>
mov    %eax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xbc4(%rip),%rsi
call   1050 <strcspn@plt>
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x60(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     149a <rfc2822_parse_date+0x30a>
mov    -0x18(%rbp),%rdi
movslq -0x60(%rbp),%rax
add    %rax,%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x3c,%eax,%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%edi
call   1030 <abs@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x68(%rbp),%eax
add    %edx,%eax
imul   $0x3c,%eax,%ecx
mov    -0x48(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
lea    -0x50(%rbp),%rdi
call   1090 <timegm@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    0x2bb5(%rip),%rax
jle    14f8 <rfc2822_parse_date+0x368>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %rax,0x2b9f(%rip)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    0x2b91(%rip),%rax
jle    14f3 <rfc2822_parse_date+0x363>
mov    0x2b84(%rip),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    14f8 <rfc2822_parse_date+0x368>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc2822_parse_date>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r14
mov    %rsi,(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
sub    %ebp,%ebx
mov    %rbp,%rdi
mov    $0x2c,%esi
mov    %ebx,%edx
call   1050 <memchr@plt>
test   %rax,%rax
je     11c4 <rfc2822_parse_date+0x44>
add    $0x1,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   10a0 <get_unsigned@plt>
mov    %rax,0x28(%rsp)
mov    (%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsp)
movsbl (%rax),%edi
call   1070 <tolower@plt>
mov    %eax,%ebx
mov    (%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsp)
movsbl (%rax),%edi
call   1070 <tolower@plt>
mov    %eax,%ebp
mov    (%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsp)
movsbl (%rax),%edi
call   1070 <tolower@plt>
cmp    $0x66,%bl
je     1238 <rfc2822_parse_date+0xb8>
cmp    $0x6d,%bl
je     1245 <rfc2822_parse_date+0xc5>
cmp    $0x6a,%bl
jne    1253 <rfc2822_parse_date+0xd3>
cmp    $0x61,%bpl
jne    1263 <rfc2822_parse_date+0xe3>
movl   $0x0,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0x1,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
cmp    $0x72,%al
jne    1271 <rfc2822_parse_date+0xf1>
movl   $0x2,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
cmp    $0x70,%bpl
jne    127b <rfc2822_parse_date+0xfb>
movl   $0x3,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
cmp    $0x6e,%al
jne    12a0 <rfc2822_parse_date+0x120>
movl   $0x5,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0x4,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
add    $0x9f,%bl
cmp    $0x12,%bl
ja     12aa <rfc2822_parse_date+0x12a>
movzbl %bl,%eax
lea    0xd73(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x7,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0x6,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0xb,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0xa,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0x9,0x8(%rsp)
jmp    12d0 <rfc2822_parse_date+0x150>
movl   $0x8,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   10a0 <get_unsigned@plt>
lea    -0x76c(%rax),%ecx
cmp    $0x76d,%eax
cmovl  %eax,%ecx
lea    0x64(%rcx),%eax
cmp    $0x46,%ecx
cmovge %ecx,%eax
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
call   10a0 <get_unsigned@plt>
mov    %rax,0x20(%rsp)
mov    (%rsp),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsp)
mov    $0xffffffff,%ebx
cmpb   $0x3a,(%rax)
jne    13ea <rfc2822_parse_date+0x26a>
mov    %rsp,%rdi
mov    $0x2,%esi
call   10a0 <get_unsigned@plt>
mov    %rax,0x18(%rsp)
mov    (%rsp),%rax
lea    0x1(%rax),%rbx
mov    %rbx,(%rsp)
cmpb   $0x3a,(%rax)
jne    135f <rfc2822_parse_date+0x1df>
mov    %rsp,%rdi
mov    $0x2,%esi
call   10a0 <get_unsigned@plt>
mov    %eax,0x10(%rsp)
mov    (%rsp),%rbx
lea    0xce6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcspn@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
je     13ba <rfc2822_parse_date+0x23a>
add    %rax,%rbx
mov    %rbx,%rdi
call   1090 <atoi@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
mov    %eax,%edx
neg    %edx
cmovs  %eax,%edx
imul   $0x51eb851f,%rdx,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
sub    %eax,%edx
add    %ecx,%edx
imul   $0xffffffc4,%edx,%eax
add    %eax,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1080 <timegm@plt>
mov    %rax,(%r14)
xor    %ebx,%ebx
cmp    0x2c98(%rip),%rax
jle    13ea <rfc2822_parse_date+0x26a>
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,0x2c86(%rip)
cmp    %rax,(%r14)
jle    13ea <rfc2822_parse_date+0x26a>
mov    %rax,(%r14)
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i8*, i8*, i8* }
@.str = [3 x i8] c"-+\00"
@rfc2822_parse_date.recently = internal global i64 0
define i32 @rfc2822_parse_date(i64* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.tm
%10 = alloca i8*
%11 = alloca [3 x i8]
%12 = alloca i32
%13 = alloca i32
store i64* %0, i64** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%14 = call i32 @memset(%struct.tm* %9, i32 0, i32 40)
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i8*, i8** %6
%18 = ptrtoint i8* %16 to i64
%19 = ptrtoint i8* %17 to i64
%20 = sub i64 %18, %19
%21 = trunc i64 %20 to i32
%22 = call i8* @memchr(i8* %15, i8 signext 44, i32 %21)
store i8* %22, i8** %10
%23 = load i8*, i8** %10
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %28
25: ; preds = %3
%26 = load i8*, i8** %10
%27 = getelementptr inbounds i8, i8* %26, i64 1
store i8* %27, i8** %6
br label %28
28: ; preds = %25, %3
%29 = call i8* @get_unsigned(i8** %6, i32 2)
%30 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 5
store i8* %29, i8** %30
store i32 0, i32* %8
br label %31
31: ; preds = %43, %28
%32 = load i32, i32* %8
%33 = icmp slt i32 %32, 3
br i1 %33, label %34, label %46
34: ; preds = %31
%35 = load i8*, i8** %6
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %6
%37 = load i8, i8* %35
%38 = sext i8 %37 to i32
%39 = call signext i8 @tolower(i32 %38)
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 %41
store i8 %39, i8* %42
br label %43
43: ; preds = %34
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %31
46: ; preds = %31
%47 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 106
br i1 %50, label %51, label %69
51: ; preds = %46
%52 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 97
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 0, i32* %57
br label %68
58: ; preds = %51
%59 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 2
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 110
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 5, i32* %64
br label %67
65: ; preds = %58
%66 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 6, i32* %66
br label %67
67: ; preds = %65, %63
br label %68
68: ; preds = %67, %56
br label %135
69: ; preds = %46
%70 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 102
br i1 %73, label %74, label %76
74: ; preds = %69
%75 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 1, i32* %75
br label %134
76: ; preds = %69
%77 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 109
br i1 %80, label %81, label %91
81: ; preds = %76
%82 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 2
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp eq i32 %84, 114
br i1 %85, label %86, label %88
86: ; preds = %81
%87 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 2, i32* %87
br label %90
88: ; preds = %81
%89 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 4, i32* %89
br label %90
90: ; preds = %88, %86
br label %133
91: ; preds = %76
%92 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 1
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 112
br i1 %95, label %96, label %98
96: ; preds = %91
%97 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 3, i32* %97
br label %132
98: ; preds = %91
%99 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 97
br i1 %102, label %103, label %105
103: ; preds = %98
%104 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 7, i32* %104
br label %131
105: ; preds = %98
%106 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp eq i32 %108, 115
br i1 %109, label %110, label %112
110: ; preds = %105
%111 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 8, i32* %111
br label %130
112: ; preds = %105
%113 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 111
br i1 %116, label %117, label %119
117: ; preds = %112
%118 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 9, i32* %118
br label %129
119: ; preds = %112
%120 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 110
br i1 %123, label %124, label %126
124: ; preds = %119
%125 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 10, i32* %125
br label %128
126: ; preds = %119
%127 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
store i32 11, i32* %127
br label %128
128: ; preds = %126, %124
br label %129
129: ; preds = %128, %117
br label %130
130: ; preds = %129, %110
br label %131
131: ; preds = %130, %103
br label %132
132: ; preds = %131, %96
br label %133
133: ; preds = %132, %90
br label %134
134: ; preds = %133, %74
br label %135
135: ; preds = %134, %68
%136 = call i8* @get_unsigned(i8** %6, i32 4)
%137 = ptrtoint i8* %136 to i32
%138 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
store i32 %137, i32* %138
%139 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
%140 = load i32, i32* %139
%141 = icmp sgt i32 %140, 1900
br i1 %141, label %142, label %146
142: ; preds = %135
%143 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
%144 = load i32, i32* %143
%145 = sub nsw i32 %144, 1900
store i32 %145, i32* %143
br label %146
146: ; preds = %142, %135
%147 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
%148 = load i32, i32* %147
%149 = icmp slt i32 %148, 70
br i1 %149, label %150, label %154
150: ; preds = %146
%151 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
%152 = load i32, i32* %151
%153 = add nsw i32 %152, 100
store i32 %153, i32* %151
br label %154
154: ; preds = %150, %146
%155 = call i8* @get_unsigned(i8** %6, i32 2)
%156 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 4
store i8* %155, i8** %156
%157 = load i8*, i8** %6
%158 = getelementptr inbounds i8, i8* %157, i32 1
store i8* %158, i8** %6
%159 = load i8, i8* %157
%160 = sext i8 %159 to i32
%161 = icmp ne i32 %160, 58
br i1 %161, label %162, label %163
162: ; preds = %154
store i32 -1, i32* %4
br label %219
163: ; preds = %154
%164 = call i8* @get_unsigned(i8** %6, i32 2)
%165 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 3
store i8* %164, i8** %165
%166 = load i8*, i8** %6
%167 = getelementptr inbounds i8, i8* %166, i32 1
store i8* %167, i8** %6
%168 = load i8, i8* %166
%169 = sext i8 %168 to i32
%170 = icmp eq i32 %169, 58
br i1 %170, label %171, label %175
171: ; preds = %163
%172 = call i8* @get_unsigned(i8** %6, i32 2)
%173 = ptrtoint i8* %172 to i32
%174 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 2
store i32 %173, i32* %174
br label %175
175: ; preds = %171, %163
%176 = load i8*, i8** %6
%177 = call i32 @strcspn(i8* %176, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %177, i32* %12
%178 = load i8*, i8** %6
%179 = load i32, i32* %12
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8, i8* %178, i64 %180
%182 = load i8, i8* %181
%183 = icmp ne i8 %182, 0
br i1 %183, label %184, label %201
184: ; preds = %175
%185 = load i8*, i8** %6
%186 = load i32, i32* %12
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %185, i64 %187
%189 = call i32 @atoi(i8* %188)
store i32 %189, i32* %13
%190 = load i32, i32* %13
%191 = sdiv i32 %190, 100
%192 = mul nsw i32 %191, 60
%193 = load i32, i32* %13
%194 = call i32 @abs(i32 %193)
%195 = srem i32 %194, 100
%196 = add nsw i32 %192, %195
%197 = mul nsw i32 %196, 60
%198 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 2
%199 = load i32, i32* %198
%200 = sub nsw i32 %199, %197
store i32 %200, i32* %198
br label %201
201: ; preds = %184, %175
%202 = call i64 @timegm(%struct.tm* %9)
%203 = load i64*, i64** %5
store i64 %202, i64* %203
%204 = load i64*, i64** %5
%205 = load i64, i64* %204
%206 = load i64, i64* @rfc2822_parse_date.recently
%207 = icmp sgt i64 %205, %206
br i1 %207, label %208, label %218
208: ; preds = %201
%209 = call i64 @time(i32* null)
store i64 %209, i64* @rfc2822_parse_date.recently
%210 = load i64*, i64** %5
%211 = load i64, i64* %210
%212 = load i64, i64* @rfc2822_parse_date.recently
%213 = icmp sgt i64 %211, %212
br i1 %213, label %214, label %217
214: ; preds = %208
%215 = load i64, i64* @rfc2822_parse_date.recently
%216 = load i64*, i64** %5
store i64 %215, i64* %216
br label %217
217: ; preds = %214, %208
br label %218
218: ; preds = %217, %201
store i32 0, i32* %4
br label %219
219: ; preds = %218, %162
%220 = load i32, i32* %4
ret i32 %220
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i8*, i8*, i8* }
@.str = [3 x i8] c"-+\00"
@rfc2822_parse_date.recently = internal unnamed_addr global i64 0
define i32 @rfc2822_parse_date(i64* nocapture %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.tm
store i8* %1, i8** %4
%6 = bitcast %struct.tm* %5 to i8*
%7 = call i32 @memset(%struct.tm* %5, i32 0, i32 40)
%8 = ptrtoint i8* %2 to i64
%9 = ptrtoint i8* %1 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @memchr(i8* %1, i8 signext 44, i32 %11)
%13 = icmp eq i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %3
%15 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %15, i8** %4
br label %16
16: ; preds = %14, %3
%17 = call i8* @get_unsigned(i8** %4, i32 2)
%18 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 5
store i8* %17, i8** %18
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8* %20, i8** %4
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = call signext i8 @tolower(i32 %22)
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8* %25, i8** %4
%26 = load i8, i8* %24
%27 = sext i8 %26 to i32
%28 = call signext i8 @tolower(i32 %27)
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 1
store i8* %30, i8** %4
%31 = load i8, i8* %29
%32 = sext i8 %31 to i32
%33 = call signext i8 @tolower(i32 %32)
switch i8 %23, label %50 [
i8 106, label %34
i8 102, label %43
i8 109, label %45
]
34: ; preds = %16
%35 = icmp eq i8 %28, 97
br i1 %35, label %36, label %38
36: ; preds = %34
%37 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 0, i32* %37
br label %65
38: ; preds = %34
%39 = icmp eq i8 %33, 110
%40 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
br i1 %39, label %41, label %42
41: ; preds = %38
store i32 5, i32* %40
br label %65
42: ; preds = %38
store i32 6, i32* %40
br label %65
43: ; preds = %16
%44 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 1, i32* %44
br label %65
45: ; preds = %16
%46 = icmp eq i8 %33, 114
%47 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
br i1 %46, label %48, label %49
48: ; preds = %45
store i32 2, i32* %47
br label %65
49: ; preds = %45
store i32 4, i32* %47
br label %65
50: ; preds = %16
%51 = icmp eq i8 %28, 112
br i1 %51, label %52, label %54
52: ; preds = %50
%53 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 3, i32* %53
br label %65
54: ; preds = %50
switch i8 %23, label %63 [
i8 97, label %55
i8 115, label %57
i8 111, label %59
i8 110, label %61
]
55: ; preds = %54
%56 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 7, i32* %56
br label %65
57: ; preds = %54
%58 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 8, i32* %58
br label %65
59: ; preds = %54
%60 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 9, i32* %60
br label %65
61: ; preds = %54
%62 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 10, i32* %62
br label %65
63: ; preds = %54
%64 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
store i32 11, i32* %64
br label %65
65: ; preds = %43, %52, %57, %61, %63, %59, %55, %48, %49, %36, %42, %41
%66 = call i8* @get_unsigned(i8** %4, i32 4)
%67 = ptrtoint i8* %66 to i64
%68 = trunc i64 %67 to i32
%69 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 1
%70 = icmp sgt i32 %68, 1900
%71 = add nsw i32 %68, -1900
%72 = select i1 %70, i32 %71, i32 %68
%73 = icmp slt i32 %72, 70
%74 = add nsw i32 %72, 100
%75 = select i1 %73, i32 %74, i32 %72
store i32 %75, i32* %69
%76 = call i8* @get_unsigned(i8** %4, i32 2)
%77 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 4
store i8* %76, i8** %77
%78 = load i8*, i8** %4
%79 = getelementptr inbounds i8, i8* %78, i64 1
store i8* %79, i8** %4
%80 = load i8, i8* %78
%81 = icmp eq i8 %80, 58
br i1 %81, label %82, label %122
82: ; preds = %65
%83 = call i8* @get_unsigned(i8** %4, i32 2)
%84 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 3
store i8* %83, i8** %84
%85 = load i8*, i8** %4
%86 = getelementptr inbounds i8, i8* %85, i64 1
store i8* %86, i8** %4
%87 = load i8, i8* %85
%88 = icmp eq i8 %87, 58
br i1 %88, label %89, label %95
89: ; preds = %82
%90 = call i8* @get_unsigned(i8** %4, i32 2)
%91 = ptrtoint i8* %90 to i64
%92 = trunc i64 %91 to i32
%93 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 2
store i32 %92, i32* %93
%94 = load i8*, i8** %4
br label %95
95: ; preds = %89, %82
%96 = phi i8* [ %94, %89 ], [ %86, %82 ]
%97 = call i32 @strcspn(i8* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8, i8* %96, i64 %98
%100 = load i8, i8* %99
%101 = icmp eq i8 %100, 0
br i1 %101, label %113, label %102
102: ; preds = %95
%103 = call i32 @atoi(i8* %99)
%104 = sdiv i32 %103, 100
%105 = mul nsw i32 %104, 60
%106 = call i32 @llvm.abs.i32(i32 %103, i1 true)
%107 = urem i32 %106, 100
%108 = add nsw i32 %105, %107
%109 = mul i32 %108, -60
%110 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 2
%111 = load i32, i32* %110
%112 = add i32 %109, %111
store i32 %112, i32* %110
br label %113
113: ; preds = %102, %95
%114 = call i64 @timegm(%struct.tm* %5)
store i64 %114, i64* %0
%115 = load i64, i64* @rfc2822_parse_date.recently
%116 = icmp sgt i64 %114, %115
br i1 %116, label %117, label %122
117: ; preds = %113
%118 = call i64 @time(i32* null)
store i64 %118, i64* @rfc2822_parse_date.recently
%119 = load i64, i64* %0
%120 = icmp sgt i64 %119, %118
br i1 %120, label %121, label %122
121: ; preds = %117
store i64 %118, i64* %0
br label %122
122: ; preds = %113, %121, %117, %65
%123 = phi i32 [ -1, %65 ], [ 0, %117 ], [ 0, %121 ], [ 0, %113 ]
ret i32 %123
}