#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 time_t;
struct tm {
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_hour;
  int tm_min;
  int tm_sec;
  int tm_isdst;
};

/* Variables and functions */
int atoi(char const *);
void *make_month(char const *);
int make_num(char const *);
int /*<<< orphan*/ memset(struct tm *, char, int);
int mktime(struct tm *);
char *strchr(char const *, char);
scalar_t__ strlen(char const *);
scalar_t__ xisdigit(char const);
time_t parse_rfc1123(const char *str) {
  const char *s;
  struct tm tm;
  time_t t;
  if (!str)
    return -1;
  memset(&tm, '\0', sizeof(struct tm));
  if ((s = strchr(str, ','))) {
    s++;
    while (*s == ' ')
      s++;
    if (xisdigit(*s) && !xisdigit(*(s + 1)))
      s--;
    if (strchr(s, '-')) {
      if ((int)strlen(s) < 18)
        return -1;
      tm.tm_mday = make_num(s);
      tm.tm_mon = make_month(s + 3);
      tm.tm_year = make_num(s + 7);
      if (tm.tm_year < 70)
        tm.tm_year += 100;
      tm.tm_hour = make_num(s + 10);
      tm.tm_min = make_num(s + 13);
      tm.tm_sec = make_num(s + 16);
    } else {
      if ((int)strlen(s) < 20)
        return -1;
      tm.tm_mday = make_num(s);
      tm.tm_mon = make_month(s + 3);
      tm.tm_year = (100 * make_num(s + 7) - 1900) + make_num(s + 9);
      tm.tm_hour = make_num(s + 12);
      tm.tm_min = make_num(s + 15);
      tm.tm_sec = make_num(s + 18);
    }
  } else {
    s = str;
    while (*s && *s == ' ')
      s++;
    if ((int)strlen(s) < 24)
      return -1;
    tm.tm_mday = make_num(s + 8);
    tm.tm_mon = make_month(s + 4);
    tm.tm_year = atoi(s + 20) - 1900;
    tm.tm_hour = make_num(s + 11);
    tm.tm_min = make_num(s + 14);
    tm.tm_sec = make_num(s + 17);
  }
  if (tm.tm_sec < 0 || tm.tm_sec > 59 || tm.tm_min < 0 || tm.tm_min > 59 ||
      tm.tm_hour < 0 || tm.tm_hour > 23 || tm.tm_mday < 1 || tm.tm_mday > 31 ||
      tm.tm_mon < 0 || tm.tm_mon > 11 || tm.tm_year < 70 || tm.tm_year > 120) {
    return -1;
  }
  tm.tm_isdst = -1;
  t = mktime(&tm);
  {
    time_t dst = 0;
    extern time_t timezone;
    if (tm.tm_isdst > 0)
      dst = -3600;
    t -= (timezone + dst);
  }
  return t;
}


x86 assembly (clang, -O0):
<parse_rfc1123>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a3 <parse_rfc1123+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1517 <parse_rfc1123+0x397>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1060 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     137d <parse_rfc1123+0x1fd>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    11fc <parse_rfc1123+0x7c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11db <parse_rfc1123+0x5b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <xisdigit@plt>
cmp    $0x0,%rax
je     1235 <parse_rfc1123+0xb5>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1040 <xisdigit@plt>
cmp    $0x0,%rax
jne    1235 <parse_rfc1123+0xb5>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
je     12df <parse_rfc1123+0x15f>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x12,%eax
jge    126b <parse_rfc1123+0xeb>
movl   $0xffffffff,-0x4(%rbp)
jmp    1517 <parse_rfc1123+0x397>
mov    -0x18(%rbp),%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x3,%rdi
call   1070 <make_month@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x7,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x46,-0x30(%rbp)
jge    12aa <parse_rfc1123+0x12a>
mov    -0x30(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xa,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xd,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x24(%rbp)
jmp    1378 <parse_rfc1123+0x1f8>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x14,%eax
jge    12fd <parse_rfc1123+0x17d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1517 <parse_rfc1123+0x397>
mov    -0x18(%rbp),%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x3,%rdi
call   1070 <make_month@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x7,%rdi
call   10a0 <make_num@plt>
imul   $0x64,%eax,%eax
sub    $0x76c,%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x9,%rdi
call   10a0 <make_num@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xc,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xf,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x12,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x24(%rbp)
jmp    144e <parse_rfc1123+0x2ce>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x45(%rbp)
je     13aa <parse_rfc1123+0x22a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
test   $0x1,%al
jne    13ba <parse_rfc1123+0x23a>
jmp    13cb <parse_rfc1123+0x24b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1385 <parse_rfc1123+0x205>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x18,%eax
jge    13e9 <parse_rfc1123+0x269>
movl   $0xffffffff,-0x4(%rbp)
jmp    1517 <parse_rfc1123+0x397>
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
call   1070 <make_month@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x14,%rdi
call   1090 <atoi@plt>
sub    $0x76c,%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xb,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xe,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x11,%rdi
call   10a0 <make_num@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     14c6 <parse_rfc1123+0x346>
cmpl   $0x3b,-0x24(%rbp)
jg     14c6 <parse_rfc1123+0x346>
cmpl   $0x0,-0x28(%rbp)
jl     14c6 <parse_rfc1123+0x346>
cmpl   $0x3b,-0x28(%rbp)
jg     14c6 <parse_rfc1123+0x346>
cmpl   $0x0,-0x2c(%rbp)
jl     14c6 <parse_rfc1123+0x346>
cmpl   $0x17,-0x2c(%rbp)
jg     14c6 <parse_rfc1123+0x346>
cmpl   $0x1,-0x38(%rbp)
jl     14c6 <parse_rfc1123+0x346>
cmpl   $0x1f,-0x38(%rbp)
jg     14c6 <parse_rfc1123+0x346>
cmpl   $0x0,-0x34(%rbp)
jl     14c6 <parse_rfc1123+0x346>
cmpl   $0xb,-0x34(%rbp)
jg     14c6 <parse_rfc1123+0x346>
cmpl   $0x46,-0x30(%rbp)
jl     14c6 <parse_rfc1123+0x346>
cmpl   $0x78,-0x30(%rbp)
jle    14d2 <parse_rfc1123+0x352>
movl   $0xffffffff,-0x4(%rbp)
jmp    1517 <parse_rfc1123+0x397>
movl   $0xffffffff,-0x20(%rbp)
lea    -0x38(%rbp),%rdi
call   1080 <mktime@plt>
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    14fd <parse_rfc1123+0x37d>
movl   $0xfffff1f0,-0x40(%rbp)
mov    0x2adc(%rip),%rax
mov    (%rax),%ecx
add    -0x40(%rbp),%ecx
mov    -0x3c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_rfc1123>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    $0xffffffff,%r14d
test   %rdi,%rdi
je     13ca <parse_rfc1123+0x24a>
mov    %rdi,%rbp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1060 <memset@plt>
mov    %rbp,%rdi
mov    $0x2c,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     1278 <parse_rfc1123+0xf8>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
cmp    $0x20,%al
je     11d0 <parse_rfc1123+0x50>
movsbl %al,%edi
call   1040 <xisdigit@plt>
test   %rax,%rax
je     11fd <parse_rfc1123+0x7d>
lea    -0x1(%rbx),%rbp
movsbl 0x1(%rbx),%edi
call   1040 <xisdigit@plt>
test   %rax,%rax
cmove  %rbp,%rbx
mov    %rbx,%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %rbp,%rbp
je     12e9 <parse_rfc1123+0x169>
cmp    $0x12,%eax
jl     13ca <parse_rfc1123+0x24a>
mov    %rbx,%rdi
call   10a0 <make_num@plt>
mov    %eax,(%rsp)
lea    0x3(%rbx),%rdi
call   1070 <make_month@plt>
mov    %eax,0x4(%rsp)
lea    0x7(%rbx),%rdi
call   10a0 <make_num@plt>
lea    0x64(%rax),%ecx
cmp    $0x46,%eax
cmovge %eax,%ecx
mov    %ecx,0x8(%rsp)
lea    0xa(%rbx),%rdi
call   10a0 <make_num@plt>
mov    %eax,0xc(%rsp)
lea    0xd(%rbx),%rdi
call   10a0 <make_num@plt>
mov    %eax,0x10(%rsp)
add    $0x10,%rbx
jmp    1348 <parse_rfc1123+0x1c8>
add    $0xa,%rbp
nopl   0x0(%rax)
cmpb   $0x20,-0xa(%rbp)
lea    0x1(%rbp),%rbp
je     1280 <parse_rfc1123+0x100>
lea    -0xb(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x18,%eax
jl     13ca <parse_rfc1123+0x24a>
lea    -0x3(%rbp),%rdi
call   10a0 <make_num@plt>
mov    %eax,(%rsp)
lea    -0x7(%rbp),%rdi
call   1070 <make_month@plt>
mov    %eax,0x4(%rsp)
lea    0x9(%rbp),%rdi
call   1090 <atoi@plt>
add    $0xfffff894,%eax
mov    %eax,0x8(%rsp)
mov    %rbp,%rdi
call   10a0 <make_num@plt>
mov    %eax,0xc(%rsp)
lea    0x3(%rbp),%rdi
call   10a0 <make_num@plt>
mov    %eax,0x10(%rsp)
add    $0x6,%rbp
mov    %rbp,%rbx
jmp    1348 <parse_rfc1123+0x1c8>
cmp    $0x14,%eax
jl     13ca <parse_rfc1123+0x24a>
mov    %rbx,%rdi
call   10a0 <make_num@plt>
mov    %eax,(%rsp)
lea    0x3(%rbx),%rdi
call   1070 <make_month@plt>
mov    %eax,0x4(%rsp)
lea    0x7(%rbx),%rdi
call   10a0 <make_num@plt>
imul   $0x64,%eax,%ebp
lea    0x9(%rbx),%rdi
call   10a0 <make_num@plt>
add    %ebp,%eax
add    $0xfffff894,%eax
mov    %eax,0x8(%rsp)
lea    0xc(%rbx),%rdi
call   10a0 <make_num@plt>
mov    %eax,0xc(%rsp)
lea    0xf(%rbx),%rdi
call   10a0 <make_num@plt>
mov    %eax,0x10(%rsp)
add    $0x12,%rbx
mov    %rbx,%rdi
call   10a0 <make_num@plt>
mov    %eax,0x14(%rsp)
cmp    $0x3b,%eax
ja     13ca <parse_rfc1123+0x24a>
mov    0x10(%rsp),%eax
test   %eax,%eax
js     13ca <parse_rfc1123+0x24a>
cmp    $0x3b,%eax
jg     13ca <parse_rfc1123+0x24a>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     13ca <parse_rfc1123+0x24a>
cmp    $0x17,%eax
jg     13ca <parse_rfc1123+0x24a>
mov    (%rsp),%eax
test   %eax,%eax
jle    13ca <parse_rfc1123+0x24a>
cmp    $0x1f,%eax
jg     13ca <parse_rfc1123+0x24a>
mov    0x4(%rsp),%eax
test   %eax,%eax
js     13ca <parse_rfc1123+0x24a>
cmp    $0xb,%eax
jg     13ca <parse_rfc1123+0x24a>
mov    0x8(%rsp),%eax
cmp    $0x46,%eax
jl     13ca <parse_rfc1123+0x24a>
cmp    $0x78,%eax
jg     13ca <parse_rfc1123+0x24a>
movl   $0xffffffff,0x18(%rsp)
ff
mov    %rsp,%rdi
call   1080 <mktime@plt>
mov    0x2c2f(%rip),%rcx
mov    (%rcx),%ecx
mov    %eax,%edx
sub    %ecx,%edx
neg    %ecx
cmpl   $0x0,0x18(%rsp)
lea    0xe10(%rax,%rcx,1),%r14d
cmovle %edx,%r14d
mov    %r14d,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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