#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*/ time_t;
struct tm {
  int tm_mon;
  int tm_mday;
  int tm_year;
  scalar_t__ tm_isdst;
  scalar_t__ tm_yday;
  scalar_t__ tm_wday;
};

/* Variables and functions */
int /*<<< orphan*/ byte_diff(char const *, int, char *);
int /*<<< orphan*/ case_diffb(char const *, int, char const *);
char *getenv(char *);
int /*<<< orphan*/ mktime(struct tm *);
scalar_t__ parsetime(char const *, struct tm *);
int /*<<< orphan*/ scan_ulong(char const *, unsigned long *);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ unsetenv(char *);
size_t scan_httpdate(const char *in, time_t *t) {
  struct tm x;
  int i;
  unsigned long tmp;
  const char *c;
  static const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
  if (!(c = in))
    return 0;
  if (c[3] == ',')
    c += 5;
  else if (c[6] == ',')
    c += 8;
  else {
    c += 4;
    for (i = 0; i < 12; ++i) {
      if ((!case_diffb((c), (3), (months + i * 3)))) {
        x.tm_mon = i;
        break;
      }
    }
    c += 4;
    if (*c == ' ')
      ++c;
    c += scan_ulong(c, &tmp);
    x.tm_mday = (int)tmp;
    ++c;
    if (parsetime(c, &x))
      return 0;
    c += 9;
    c += scan_ulong(c, &tmp);
    x.tm_year = (int)(tmp - 1900);
    goto done;
  }
  c += scan_ulong(c, &tmp);
  x.tm_mday = (int)tmp;
  while (*c == ' ')
    ++c;
  for (i = 0; i < 12; ++i)
    if ((!case_diffb((c), (3), (months + i * 3)))) {
      x.tm_mon = i;
      break;
    }
  c += 4;
  c += scan_ulong(c, &tmp);
  if (tmp > 1000)
    x.tm_year = (int)(tmp - 1900);
  else if (tmp < 70)
    x.tm_year = (int)(tmp + 100);
  else
    x.tm_year = (int)tmp;
  ++c;
  if (parsetime(c, &x))
    return 0;
  c += 9;
  if ((!byte_diff((c), (3), ("GMT"))))
    c += 3;
  if (*c == '+' || *c == '-') {
    ++c;
    while (*c >= '0' && *c <= '9')
      ++c;
  }
done:
  x.tm_wday = x.tm_yday = x.tm_isdst = 0;
  {
    char *old = getenv("TZ");
    unsetenv("TZ");
    *t = mktime(&x);
    if (old)
      setenv("TZ", old, 1);
  }
  return (size_t)(c - in);
}


x86 assembly (clang, -O0):
<scan_httpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    11af <scan_httpdate+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1572 <scan_httpdate+0x3f2>
mov    -0x58(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x2c,%eax
jne    11d1 <scan_httpdate+0x51>
mov    -0x58(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x58(%rbp)
jmp    1311 <scan_httpdate+0x191>
mov    -0x58(%rbp),%rax
movsbl 0x6(%rax),%eax
cmp    $0x2c,%eax
jne    11f3 <scan_httpdate+0x73>
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
jmp    130c <scan_httpdate+0x18c>
mov    -0x58(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jge    1255 <scan_httpdate+0xd5>
mov    -0x58(%rbp),%rdi
imul   $0x3,-0x44(%rbp),%eax
cltq
lea    0xddf(%rip),%rdx
add    %rax,%rdx
mov    $0x3,%esi
call   1070 <case_diffb@plt>
cmp    $0x0,%eax
jne    1242 <scan_httpdate+0xc2>
mov    -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1255 <scan_httpdate+0xd5>
jmp    1247 <scan_httpdate+0xc7>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1206 <scan_httpdate+0x86>
mov    -0x58(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    127d <scan_httpdate+0xfd>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <scan_ulong@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rax
mov    %eax,-0x3c(%rbp)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1080 <parsetime@plt>
cmp    $0x0,%rax
je     12d1 <scan_httpdate+0x151>
movq   $0x0,-0x8(%rbp)
jmp    1572 <scan_httpdate+0x3f2>
mov    -0x58(%rbp),%rax
add    $0x9,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <scan_ulong@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rax
sub    $0x76c,%rax
mov    %eax,-0x38(%rbp)
jmp    14fe <scan_httpdate+0x37e>
jmp    1311 <scan_httpdate+0x191>
mov    -0x58(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <scan_ulong@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rax
mov    %eax,-0x3c(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1356 <scan_httpdate+0x1d6>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    1335 <scan_httpdate+0x1b5>
movl   $0x0,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jge    13ac <scan_httpdate+0x22c>
mov    -0x58(%rbp),%rdi
imul   $0x3,-0x44(%rbp),%eax
cltq
lea    0xc88(%rip),%rdx
add    %rax,%rdx
mov    $0x3,%esi
call   1070 <case_diffb@plt>
cmp    $0x0,%eax
jne    1399 <scan_httpdate+0x219>
mov    -0x44(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    13ac <scan_httpdate+0x22c>
jmp    139e <scan_httpdate+0x21e>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    135d <scan_httpdate+0x1dd>
mov    -0x58(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <scan_ulong@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x3e8,-0x50(%rbp)
jbe    13f5 <scan_httpdate+0x275>
mov    -0x50(%rbp),%rax
sub    $0x76c,%rax
mov    %eax,-0x38(%rbp)
jmp    141c <scan_httpdate+0x29c>
cmpq   $0x46,-0x50(%rbp)
jae    1410 <scan_httpdate+0x290>
mov    -0x50(%rbp),%rax
add    $0x64,%rax
mov    %eax,-0x38(%rbp)
jmp    1417 <scan_httpdate+0x297>
mov    -0x50(%rbp),%rax
mov    %eax,-0x38(%rbp)
jmp    141c <scan_httpdate+0x29c>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1080 <parsetime@plt>
cmp    $0x0,%rax
je     144c <scan_httpdate+0x2cc>
movq   $0x0,-0x8(%rbp)
jmp    1572 <scan_httpdate+0x3f2>
mov    -0x58(%rbp),%rax
add    $0x9,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0x3,%esi
lea    0xbbd(%rip),%rdx
call   1060 <byte_diff@plt>
cmp    $0x0,%eax
jne    1482 <scan_httpdate+0x302>
mov    -0x58(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     14a2 <scan_httpdate+0x322>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    14f9 <scan_httpdate+0x379>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x61(%rbp)
jl     14d3 <scan_httpdate+0x353>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    14e3 <scan_httpdate+0x363>
jmp    14f4 <scan_httpdate+0x374>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    14ae <scan_httpdate+0x32e>
jmp    14f9 <scan_httpdate+0x379>
jmp    14fe <scan_httpdate+0x37e>
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xb0c(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x60(%rbp)
lea    0xafc(%rip),%rdi
call   10a0 <unsetenv@plt>
lea    -0x40(%rbp),%rdi
call   1090 <mktime@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x60(%rbp)
je     1563 <scan_httpdate+0x3e3>
mov    -0x60(%rbp),%rsi
lea    0xad0(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    -0x58(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_httpdate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
test   %rdi,%rdi
je     1638 <scan_httpdate+0x4b8>
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x5,%ebx
cmpb   $0x2c,0x3(%rdi)
je     11b8 <scan_httpdate+0x38>
mov    $0x8,%ebx
cmpb   $0x2c,0x6(%r15)
jne    1354 <scan_httpdate+0x1d4>
lea    (%r15,%rbx,1),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scan_ulong@plt>
cltq
mov    0x8(%rsp),%ecx
mov    %ecx,0x14(%rsp)
add    %rbx,%rax
lea    (%r15,%rax,1),%rbx
add    $0xd,%rbx
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,-0xd(%rbx)
lea    0x1(%rbx),%rbx
je     11e0 <scan_httpdate+0x60>
lea    -0xe(%rbx),%r12
lea    0xe0b(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     134d <scan_httpdate+0x1cd>
lea    0xdf2(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14b7 <scan_httpdate+0x337>
lea    0xdd9(%rip),%rdx
mov    $0x3,%ebp
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14be <scan_httpdate+0x33e>
lea    0xdbb(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1537 <scan_httpdate+0x3b7>
lea    0xda2(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14d6 <scan_httpdate+0x356>
lea    0xd89(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14e7 <scan_httpdate+0x367>
lea    0xd70(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14ee <scan_httpdate+0x36e>
lea    0xd57(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14ff <scan_httpdate+0x37f>
lea    0xd3e(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1510 <scan_httpdate+0x390>
lea    0xd25(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1521 <scan_httpdate+0x3a1>
lea    0xd0c(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1532 <scan_httpdate+0x3b2>
lea    0xcf3(%rip),%rdx
mov    %r12,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
jne    153b <scan_httpdate+0x3bb>
mov    $0xb,%ebp
jmp    1537 <scan_httpdate+0x3b7>
xor    %ebp,%ebp
jmp    1537 <scan_httpdate+0x3b7>
lea    0x4(%r15),%rbx
lea    0xca1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14c5 <scan_httpdate+0x345>
lea    0xc88(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14cc <scan_httpdate+0x34c>
lea    0xc6f(%rip),%rdx
mov    $0x3,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14dd <scan_httpdate+0x35d>
lea    0xc51(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     15f3 <scan_httpdate+0x473>
lea    0xc38(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     14f5 <scan_httpdate+0x375>
lea    0xc1f(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1506 <scan_httpdate+0x386>
lea    0xc06(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1517 <scan_httpdate+0x397>
lea    0xbed(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     1528 <scan_httpdate+0x3a8>
lea    0xbd4(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     15e0 <scan_httpdate+0x460>
lea    0xbbb(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     15e7 <scan_httpdate+0x467>
lea    0xba2(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
je     15ee <scan_httpdate+0x46e>
lea    0xb89(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <case_diffb@plt>
test   %eax,%eax
jne    15f7 <scan_httpdate+0x477>
mov    $0xb,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x1,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x2,%ebp
jmp    1537 <scan_httpdate+0x3b7>
xor    %ebp,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x1,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x4,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x2,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x5,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x6,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x4,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x7,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x5,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x8,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x6,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x9,%ebp
jmp    1537 <scan_httpdate+0x3b7>
mov    $0x7,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0xa,%ebp
mov    %ebp,0x10(%rsp)
lea    -0xa(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scan_ulong@plt>
movslq %eax,%r12
mov    0x8(%rsp),%rax
lea    -0x76c(%rax),%ecx
lea    0x64(%rax),%edx
cmp    $0x46,%rax
cmovae %eax,%edx
cmp    $0x3e9,%rax
cmovae %ecx,%edx
mov    %edx,0x18(%rsp)
lea    (%rbx,%r12,1),%rdi
add    $0xfffffffffffffff7,%rdi
lea    0x10(%rsp),%rsi
call   1080 <parsetime@plt>
test   %rax,%rax
jne    1638 <scan_httpdate+0x4b8>
lea    (%rbx,%r12,1),%rdi
lea    0xa91(%rip),%rdx
mov    $0x3,%esi
call   1060 <byte_diff@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,2),%rax
lea    (%rax,%r12,1),%rcx
mov    (%rbx,%rcx,1),%dl
cmp    $0x2b,%dl
je     15ba <scan_httpdate+0x43a>
cmp    $0x2d,%dl
jne    15d8 <scan_httpdate+0x458>
add    %rax,%rbx
nopl   (%rax)
movzbl 0x1(%rbx,%r12,1),%eax
add    $0xd0,%al
add    $0x1,%rbx
cmp    $0xa,%al
jb     15c0 <scan_httpdate+0x440>
add    %r12,%rbx
jmp    1660 <scan_httpdate+0x4e0>
add    %rcx,%rbx
jmp    1660 <scan_httpdate+0x4e0>
mov    $0x8,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0x9,%ebp
jmp    15f3 <scan_httpdate+0x473>
mov    $0xa,%ebp
mov    %ebp,0x10(%rsp)
lea    0x8(%r15),%rbx
lea    0x9(%r15),%rax
cmpb   $0x20,0x8(%r15)
cmove  %rax,%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scan_ulong@plt>
cltq
mov    0x8(%rsp),%ecx
mov    %ecx,0x14(%rsp)
add    %rax,%rbx
add    $0x1,%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <parsetime@plt>
test   %rax,%rax
je     163c <scan_httpdate+0x4bc>
xor    %ebx,%ebx
jmp    16b4 <scan_httpdate+0x534>
lea    0x9(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scan_ulong@plt>
cltq
add    %rax,%rbx
add    $0x9,%rbx
mov    $0xfffff894,%eax
add    0x8(%rsp),%eax
mov    %eax,0x18(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
lea    0x9b1(%rip),%r13
mov    %r13,%rdi
call   1030 <getenv@plt>
mov    %rax,%r12
mov    %r13,%rdi
call   10a0 <unsetenv@plt>
lea    0x10(%rsp),%rdi
call   1090 <mktime@plt>
mov    %eax,(%r14)
test   %r12,%r12
je     16b1 <scan_httpdate+0x531>
lea    0x985(%rip),%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
sub    %r15,%rbx
mov    %rbx,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i64, i64, i64 }
@scan_httpdate.months = internal constant [37 x i8] c"JanFebMarAprMayJunJulAugSepOctNovDec\00"
@.str = [4 x i8] c"GMT\00"
@.str.1 = [3 x i8] c"TZ\00"
define i64 @scan_httpdate(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.tm
%4 = alloca i64
%5 = bitcast %struct.tm* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = icmp eq i8* %0, null
br i1 %7, label %179, label %8
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 44
br i1 %11, label %80, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 6
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 44
br i1 %15, label %80, label %16
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %0, i64 4
%18 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %53, %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %16
%21 = phi i32 [ 0, %16 ], [ 1, %23 ], [ 2, %26 ], [ 3, %29 ], [ 4, %32 ], [ 5, %35 ], [ 6, %38 ], [ 7, %41 ], [ 8, %44 ], [ 9, %47 ], [ 10, %50 ], [ 11, %53 ]
%22 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
store i32 %21, i32* %22
br label %56
23: ; preds = %16
%24 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 3))
%25 = icmp eq i32 %24, 0
br i1 %25, label %20, label %26
26: ; preds = %23
%27 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 6))
%28 = icmp eq i32 %27, 0
br i1 %28, label %20, label %29
29: ; preds = %26
%30 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 9))
%31 = icmp eq i32 %30, 0
br i1 %31, label %20, label %32
32: ; preds = %29
%33 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 12))
%34 = icmp eq i32 %33, 0
br i1 %34, label %20, label %35
35: ; preds = %32
%36 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 15))
%37 = icmp eq i32 %36, 0
br i1 %37, label %20, label %38
38: ; preds = %35
%39 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 18))
%40 = icmp eq i32 %39, 0
br i1 %40, label %20, label %41
41: ; preds = %38
%42 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 21))
%43 = icmp eq i32 %42, 0
br i1 %43, label %20, label %44
44: ; preds = %41
%45 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 24))
%46 = icmp eq i32 %45, 0
br i1 %46, label %20, label %47
47: ; preds = %44
%48 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 27))
%49 = icmp eq i32 %48, 0
br i1 %49, label %20, label %50
50: ; preds = %47
%51 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 30))
%52 = icmp eq i32 %51, 0
br i1 %52, label %20, label %53
53: ; preds = %50
%54 = tail call i32 @case_diffb(i8* %17, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 33))
%55 = icmp eq i32 %54, 0
br i1 %55, label %20, label %56
56: ; preds = %53, %20
%57 = getelementptr inbounds i8, i8* %0, i64 8
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 32
%60 = getelementptr inbounds i8, i8* %0, i64 9
%61 = select i1 %59, i8* %60, i8* %57
%62 = call i32 @scan_ulong(i8* %61, i64* %4)
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
%65 = load i64, i64* %4
%66 = trunc i64 %65 to i32
%67 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
store i32 %66, i32* %67
%68 = getelementptr inbounds i8, i8* %64, i64 1
%69 = call i64 @parsetime(i8* %68, %struct.tm* %3)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %179
71: ; preds = %56
%72 = getelementptr inbounds i8, i8* %68, i64 9
%73 = call i32 @scan_ulong(i8* %72, i64* %4)
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %72, i64 %74
%76 = load i64, i64* %4
%77 = trunc i64 %76 to i32
%78 = add i32 %77, -1900
%79 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
store i32 %78, i32* %79
br label %165
80: ; preds = %12, %8
%81 = phi i64 [ 5, %8 ], [ 8, %12 ]
%82 = getelementptr inbounds i8, i8* %0, i64 %81
%83 = call i32 @scan_ulong(i8* %82, i64* %4)
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = load i64, i64* %4
%87 = trunc i64 %86 to i32
%88 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
store i32 %87, i32* %88
br label %89
89: ; preds = %89, %80
%90 = phi i8* [ %85, %80 ], [ %93, %89 ]
%91 = load i8, i8* %90
%92 = icmp eq i8 %91, 32
%93 = getelementptr inbounds i8, i8* %90, i64 1
br i1 %92, label %89, label %94
94: ; preds = %89
%95 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 0))
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %130, %127, %124, %121, %118, %115, %112, %109, %106, %103, %100, %94
%98 = phi i32 [ 0, %94 ], [ 1, %100 ], [ 2, %103 ], [ 3, %106 ], [ 4, %109 ], [ 5, %112 ], [ 6, %115 ], [ 7, %118 ], [ 8, %121 ], [ 9, %124 ], [ 10, %127 ], [ 11, %130 ]
%99 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
store i32 %98, i32* %99
br label %133
100: ; preds = %94
%101 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 3))
%102 = icmp eq i32 %101, 0
br i1 %102, label %97, label %103
103: ; preds = %100
%104 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 6))
%105 = icmp eq i32 %104, 0
br i1 %105, label %97, label %106
106: ; preds = %103
%107 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 9))
%108 = icmp eq i32 %107, 0
br i1 %108, label %97, label %109
109: ; preds = %106
%110 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 12))
%111 = icmp eq i32 %110, 0
br i1 %111, label %97, label %112
112: ; preds = %109
%113 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 15))
%114 = icmp eq i32 %113, 0
br i1 %114, label %97, label %115
115: ; preds = %112
%116 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 18))
%117 = icmp eq i32 %116, 0
br i1 %117, label %97, label %118
118: ; preds = %115
%119 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 21))
%120 = icmp eq i32 %119, 0
br i1 %120, label %97, label %121
121: ; preds = %118
%122 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 24))
%123 = icmp eq i32 %122, 0
br i1 %123, label %97, label %124
124: ; preds = %121
%125 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 27))
%126 = icmp eq i32 %125, 0
br i1 %126, label %97, label %127
127: ; preds = %124
%128 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 30))
%129 = icmp eq i32 %128, 0
br i1 %129, label %97, label %130
130: ; preds = %127
%131 = call i32 @case_diffb(i8* %90, i32 3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @scan_httpdate.months, i64 0, i64 33))
%132 = icmp eq i32 %131, 0
br i1 %132, label %97, label %133
133: ; preds = %130, %97
%134 = getelementptr inbounds i8, i8* %90, i64 4
%135 = call i32 @scan_ulong(i8* %134, i64* %4)
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8, i8* %134, i64 %136
%138 = load i64, i64* %4
%139 = icmp ugt i64 %138, 1000
%140 = trunc i64 %138 to i32
%141 = add i32 %140, -1900
%142 = icmp ult i64 %138, 70
%143 = trunc i64 %138 to i32
%144 = add nuw nsw i32 %143, 100
%145 = select i1 %142, i32 %144, i32 %143
%146 = select i1 %139, i32 %141, i32 %145
%147 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
store i32 %146, i32* %147
%148 = getelementptr inbounds i8, i8* %137, i64 1
%149 = call i64 @parsetime(i8* %148, %struct.tm* %3)
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %179
151: ; preds = %133
%152 = getelementptr inbounds i8, i8* %148, i64 9
%153 = call i32 @byte_diff(i8* %152, i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%154 = icmp eq i32 %153, 0
%155 = select i1 %154, i64 3, i64 0
%156 = getelementptr i8, i8* %152, i64 %155
%157 = load i8, i8* %156
switch i8 %157, label %165 [
i8 43, label %158
i8 45, label %158
]
158: ; preds = %151, %151
br label %159
159: ; preds = %158, %159
%160 = phi i8* [ %161, %159 ], [ %156, %158 ]
%161 = getelementptr inbounds i8, i8* %160, i64 1
%162 = load i8, i8* %161
%163 = add i8 %162, -48
%164 = icmp ult i8 %163, 10
br i1 %164, label %159, label %165
165: ; preds = %159, %151, %71
%166 = phi i8* [ %75, %71 ], [ %156, %151 ], [ %161, %159 ]
%167 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 3
%168 = bitcast i64* %167 to i8*
%169 = call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%170 = call i32 @unsetenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%171 = call i32 @mktime(%struct.tm* %3)
store i32 %171, i32* %1
%172 = icmp eq i8* %169, null
br i1 %172, label %175, label %173
173: ; preds = %165
%174 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %169, i32 1)
br label %175
175: ; preds = %173, %165
%176 = ptrtoint i8* %166 to i64
%177 = ptrtoint i8* %0 to i64
%178 = sub i64 %176, %177
br label %179
179: ; preds = %133, %56, %2, %175
%180 = phi i64 [ %178, %175 ], [ 0, %2 ], [ 0, %56 ], [ 0, %133 ]
ret i64 %180
}