#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 {
  char tm_sec;
  char tm_year;
  char tm_mon;
  char tm_mday;
  char tm_hour;
  char tm_min;
  int tm_isdst;
};
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ errx(int, char *);
struct tm *localtime(int *);
int mktime(struct tm *);
char *strchr(char const *, char);
int strlen(char const *);
void stime_arg1(const char *arg, struct timeval *tvp) {
  time_t now;
  struct tm *t;
  int yearset;
  char *p;
  now = tvp[0].tv_sec;
  if ((t = localtime(&now)) == NULL)
    err(1, "localtime");
  if ((p = strchr(arg, '.')) == NULL)
    t->tm_sec = 0;
  else {
    if (strlen(p + 1) != 2)
      goto terr;
    *p++ = '\0';
    t->tm_sec = ((p)[0] - '0') * 10 + ((p)[1] - '0');
    (p) += 2;
    ;
  }
  yearset = 0;
  switch (strlen(arg)) {
  case 12:
    t->tm_year = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
    (arg) += 2;
    ;
    t->tm_year *= 100;
    yearset = 1;
  case 10:
    if (yearset) {
      yearset = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
      (arg) += 2;
      ;
      t->tm_year += yearset;
    } else {
      yearset = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
      (arg) += 2;
      ;
      if (yearset < 69)
        t->tm_year = yearset + 2000;
      else
        t->tm_year = yearset + 1900;
    }
    t->tm_year -= 1900;
  case 8:
    t->tm_mon = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
    (arg) += 2;
    ;
    --t->tm_mon;
    t->tm_mday = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
    (arg) += 2;
    ;
    t->tm_hour = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
    (arg) += 2;
    ;
    t->tm_min = ((arg)[0] - '0') * 10 + ((arg)[1] - '0');
    (arg) += 2;
    ;
    break;
  default:
    goto terr;
  }
  t->tm_isdst = -1;
  tvp[0].tv_sec = tvp[1].tv_sec = mktime(t);
  if (tvp[0].tv_sec == -1)
    goto terr;
  tvp[0].tv_usec = tvp[1].tv_usec = 0;
  return;
terr:
  errx(1, "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]");
}


x86 assembly (clang, -O0):
<stime_arg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    11a1 <stime_arg1+0x41>
mov    $0x1,%edi
lea    0xe64(%rip),%rsi
call   1070 <err@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1060 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11c9 <stime_arg1+0x69>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
jmp    1224 <stime_arg1+0xc4>
mov    -0x30(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
je     11e4 <stime_arg1+0x84>
jmp    148a <stime_arg1+0x32a>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movb   $0x0,(%rax)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x30(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x30(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    %ecx,-0x34(%rbp)
sub    $0x8,%eax
je     1365 <stime_arg1+0x205>
jmp    1247 <stime_arg1+0xe7>
mov    -0x34(%rbp),%eax
sub    $0xa,%eax
je     12ad <stime_arg1+0x14d>
jmp    1258 <stime_arg1+0xf8>
mov    -0x34(%rbp),%eax
sub    $0xc,%eax
jne    1433 <stime_arg1+0x2d3>
jmp    1269 <stime_arg1+0x109>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%ecx
imul   $0x64,%ecx,%ecx
mov    %cl,0x1(%rax)
movl   $0x1,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     12f5 <stime_arg1+0x195>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%ecx
add    %edx,%ecx
mov    %cl,0x1(%rax)
jmp    1354 <stime_arg1+0x1f4>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x45,-0x24(%rbp)
jge    133e <stime_arg1+0x1de>
mov    -0x24(%rbp),%eax
add    $0x7d0,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
jmp    134f <stime_arg1+0x1ef>
mov    -0x24(%rbp),%eax
add    $0x76c,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
jmp    1354 <stime_arg1+0x1f4>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%ecx
sub    $0x76c,%ecx
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2(%rax),%cl
add    $0xff,%cl
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1438 <stime_arg1+0x2d8>
jmp    148a <stime_arg1+0x32a>
mov    -0x20(%rbp),%rax
movl   $0xffffffff,0x8(%rax)
mov    -0x20(%rbp),%rdi
call   1080 <mktime@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    146d <stime_arg1+0x30d>
jmp    148a <stime_arg1+0x32a>
mov    -0x10(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x8(%rax)
jmp    149b <stime_arg1+0x33b>
mov    $0x1,%edi
lea    0xb74(%rip),%rsi
call   1050 <errx@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stime_arg1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
mov    (%rsi),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1197 <stime_arg1+0x37>
lea    0xe73(%rip),%rsi
mov    $0x1,%edi
call   1070 <err@plt>
mov    %r12,%rdi
mov    $0x2e,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     11d1 <stime_arg1+0x71>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jne    12d4 <stime_arg1+0x174>
movb   $0x0,(%rbx)
movzbl 0x1(%rbx),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x2(%rbx),%al
add    $0xf0,%al
jmp    11d3 <stime_arg1+0x73>
xor    %eax,%eax
mov    %al,(%r15)
mov    %r12,%rdi
call   1040 <strlen@plt>
cmp    $0x8,%eax
je     124f <stime_arg1+0xef>
cmp    $0xa,%eax
je     1227 <stime_arg1+0xc7>
cmp    $0xc,%eax
jne    12d4 <stime_arg1+0x174>
movzbl (%r12),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x1(%r12),%al
movzbl %al,%eax
imul   $0x64,%eax,%ecx
add    $0xc0,%cl
mov    %cl,0x1(%r15)
movzbl 0x2(%r12),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x3(%r12),%al
add    $0x2,%r12
add    %cl,%al
add    $0xf0,%al
jmp    1245 <stime_arg1+0xe5>
movsbl (%r12),%eax
lea    (%rax,%rax,4),%eax
movsbl 0x1(%r12),%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x254,%eax
jg     1243 <stime_arg1+0xe3>
add    $0xc0,%al
jmp    1245 <stime_arg1+0xe5>
add    $0x5c,%al
add    $0x2,%r12
add    $0x94,%al
mov    %al,0x1(%r15)
movzbl (%r12),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x1(%r12),%al
add    $0xef,%al
mov    %al,0x2(%r15)
movzbl 0x2(%r12),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x3(%r12),%al
add    $0xf0,%al
mov    %al,0x3(%r15)
movzbl 0x4(%r12),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x5(%r12),%al
add    $0xf0,%al
mov    %al,0x4(%r15)
movzbl 0x6(%r12),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    0x7(%r12),%al
add    $0xf0,%al
mov    %al,0x5(%r15)
movl   $0xffffffff,0x8(%r15)
ff
mov    %r15,%rdi
call   1080 <mktime@plt>
mov    %eax,0x10(%r14)
mov    %eax,(%r14)
cmp    $0xffffffff,%eax
je     12d4 <stime_arg1+0x174>
movq   $0x0,0x18(%r14)
movq   $0x0,0x8(%r14)
jmp    12e5 <stime_arg1+0x185>
lea    0xd2f(%rip),%rsi
mov    $0x1,%edi
call   1050 <errx@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.tm = type { i8, i8, i8, i8, i8, i8, i32 }
@.str = [10 x i8] c"localtime\00"
@.str.1 = [66 x i8] c"out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]\00"
define void @stime_arg1(i8* %0, %struct.timeval* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call %struct.tm* @localtime(i32* %3)
%8 = icmp eq %struct.tm* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%13 = icmp eq i8* %12, null
br i1 %13, label %25, label %14
14: ; preds = %11
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = call i32 @strlen(i8* %15)
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %106
18: ; preds = %14
store i8 0, i8* %12
%19 = load i8, i8* %15
%20 = mul i8 %19, 10
%21 = getelementptr inbounds i8, i8* %12, i64 2
%22 = load i8, i8* %21
%23 = add i8 %22, -16
%24 = add i8 %23, %20
br label %25
25: ; preds = %11, %18
%26 = phi i8 [ %24, %18 ], [ 0, %11 ]
%27 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 0
store i8 %26, i8* %27
%28 = call i32 @strlen(i8* %0)
switch i32 %28, label %106 [
i32 12, label %29
i32 10, label %46
i32 8, label %66
]
29: ; preds = %25
%30 = load i8, i8* %0
%31 = mul i8 %30, 10
%32 = getelementptr inbounds i8, i8* %0, i64 1
%33 = load i8, i8* %32
%34 = add i8 %31, %33
%35 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%36 = getelementptr inbounds i8, i8* %0, i64 2
%37 = mul i8 %34, 100
%38 = add i8 %37, -64
store i8 %38, i8* %35
%39 = load i8, i8* %36
%40 = mul i8 %39, 10
%41 = getelementptr inbounds i8, i8* %0, i64 3
%42 = load i8, i8* %41
%43 = add i8 %42, -16
%44 = add i8 %43, %40
%45 = add i8 %44, %38
br label %60
46: ; preds = %25
%47 = load i8, i8* %0
%48 = sext i8 %47 to i32
%49 = mul nsw i32 %48, 10
%50 = getelementptr inbounds i8, i8* %0, i64 1
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = add nsw i32 %49, %52
%54 = icmp slt i32 %53, 597
%55 = trunc i32 %53 to i8
br i1 %54, label %56, label %58
56: ; preds = %46
%57 = add i8 %55, -64
br label %60
58: ; preds = %46
%59 = add i8 %55, 92
br label %60
60: ; preds = %56, %58, %29
%61 = phi i8 [ %57, %56 ], [ %59, %58 ], [ %45, %29 ]
%62 = phi i8* [ %0, %56 ], [ %0, %58 ], [ %36, %29 ]
%63 = getelementptr inbounds i8, i8* %62, i64 2
%64 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%65 = add i8 %61, -108
store i8 %65, i8* %64
br label %66
66: ; preds = %25, %60
%67 = phi i8* [ %0, %25 ], [ %63, %60 ]
%68 = load i8, i8* %67
%69 = mul i8 %68, 10
%70 = getelementptr inbounds i8, i8* %67, i64 1
%71 = load i8, i8* %70
%72 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 2
%73 = getelementptr inbounds i8, i8* %67, i64 2
%74 = add i8 %71, -17
%75 = add i8 %74, %69
store i8 %75, i8* %72
%76 = load i8, i8* %73
%77 = mul i8 %76, 10
%78 = getelementptr inbounds i8, i8* %67, i64 3
%79 = load i8, i8* %78
%80 = add i8 %79, -16
%81 = add i8 %80, %77
%82 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 3
store i8 %81, i8* %82
%83 = getelementptr inbounds i8, i8* %67, i64 4
%84 = load i8, i8* %83
%85 = mul i8 %84, 10
%86 = getelementptr inbounds i8, i8* %67, i64 5
%87 = load i8, i8* %86
%88 = add i8 %87, -16
%89 = add i8 %88, %85
%90 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 4
store i8 %89, i8* %90
%91 = getelementptr inbounds i8, i8* %67, i64 6
%92 = load i8, i8* %91
%93 = mul i8 %92, 10
%94 = getelementptr inbounds i8, i8* %67, i64 7
%95 = load i8, i8* %94
%96 = add i8 %95, -16
%97 = add i8 %96, %93
%98 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 5
store i8 %97, i8* %98
%99 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 6
store i32 -1, i32* %99
%100 = call i32 @mktime(%struct.tm* %7)
%101 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 1, i32 0
store i32 %100, i32* %101
store i32 %100, i32* %5
%102 = icmp eq i32 %100, -1
br i1 %102, label %106, label %103
103: ; preds = %66
%104 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 1, i32 1
store i64 0, i64* %104
%105 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i64 0, i64* %105
br label %108
106: ; preds = %66, %25, %14
%107 = call i32 @errx(i32 1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
br label %108
108: ; preds = %106, %103
ret void
}