#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 {
  long tm_sec;
};

/* Variables and functions */
long atol(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ isinteger(char *);
struct tm *localtime(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int mktime(struct tm *);
char *optarg;
int optind;
int /*<<< orphan*/ printUsage(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strptime(char *, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  time_t now;
  struct tm time_val;
  char buffer[80];
  char *format_s = NULL;
  char *start_s = NULL;
  char *ret_s = NULL;
  int c, len_opt;
  long secs;
  if (argc == 2 && *argv[1] == '-' && *(argv[1] + 1) == 'h') {
    printUsage(argv[0]);
    exit(0);
  }
  if (argc == 2 && *argv[1] == '-' && *(argv[1] + 1) == 'v') {
    printf("%s: version "
           "0.8"
           "\n",
           argv[0]);
    exit(0);
  }
  while ((argc - 1) != optind && ((c = getopt(argc, argv, "f:s:")) != -1)) {
    switch (c) {
    case 'f':
      len_opt = strlen(optarg);
      format_s = (char *)malloc(len_opt + 1);
      strncpy(format_s, optarg, len_opt);
      format_s[len_opt] = '\0';
      break;
    case 's':
      len_opt = strlen(optarg);
      start_s = (char *)malloc(len_opt + 1);
      strncpy(start_s, optarg, len_opt);
      start_s[len_opt] = '\0';
      break;
    case '?':
    default:
      printUsage(argv[0]);
      exit(-1);
    }
  }
  if (!isinteger(argv[argc - 1])) {
    fprintf(stderr, "invalid argument, %s is not an integer\n", argv[argc - 1]);
    printUsage(argv[0]);
    exit(-1);
  }
  secs = atol(argv[argc - 1]);
  now = time(NULL);
  time_val = *localtime(&now);
  if (format_s == NULL) {
    format_s = (char *)malloc(3);
    strncpy(format_s, "%c", 2);
    format_s[2] = '\0';
  }
  if (start_s != NULL) {
    ret_s = strptime(start_s, format_s, &time_val);
    if (ret_s == NULL || *ret_s != '\0') {
      fprintf(stderr, "strptime error\n");
      printUsage(argv[0]);
      exit(-1);
    }
    free(start_s);
  }
  time_val.tm_sec += secs;
  if (mktime(&time_val) == -1) {
    fprintf(stderr, "mktime error\n");
    printUsage(argv[0]);
    exit(-1);
  }
  strftime(buffer, 80, format_s, &time_val);
  printf("%s\n", buffer);
  free(format_s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x88(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    127a <main+0x7a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    127a <main+0x7a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    127a <main+0x7a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <printUsage@plt>
xor    %edi,%edi
call   1110 <exit@plt>
cmpl   $0x2,-0x8(%rbp)
jne    12c7 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12c7 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x76,%eax
jne    12c7 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd45(%rip),%rdi
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
jmp    12cc <main+0xcc>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    %eax,%eax
mov    0x2d05(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x99(%rbp)
je     130e <main+0x10e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xd1a(%rip),%rdx
call   1100 <getopt@plt>
mov    %eax,-0x8c(%rbp)
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%al
test   $0x1,%al
jne    1321 <main+0x121>
jmp    142b <main+0x22b>
mov    -0x8c(%rbp),%eax
mov    %eax,-0xa0(%rbp)
sub    $0x3f,%eax
je     140b <main+0x20b>
jmp    133b <main+0x13b>
mov    -0xa0(%rbp),%eax
sub    $0x66,%eax
je     1363 <main+0x163>
jmp    134f <main+0x14f>
mov    -0xa0(%rbp),%eax
sub    $0x73,%eax
je     13b7 <main+0x1b7>
jmp    1410 <main+0x210>
mov    0x2c8e(%rip),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
mov    0x2c63(%rip),%rax
mov    (%rax),%rsi
mov    -0x90(%rbp),%edx
call   1050 <strncpy@plt>
mov    -0x78(%rbp),%rax
movslq -0x90(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1426 <main+0x226>
mov    0x2c3a(%rip),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%edi
add    $0x1,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rdi
mov    0x2c0f(%rip),%rax
mov    (%rax),%rsi
mov    -0x90(%rbp),%edx
call   1050 <strncpy@plt>
mov    -0x80(%rbp),%rax
movslq -0x90(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1426 <main+0x226>
jmp    1410 <main+0x210>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <printUsage@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
jmp    12cc <main+0xcc>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <isinteger@plt>
cmp    $0x0,%eax
jne    1488 <main+0x288>
mov    0x2b7f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xbab(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <printUsage@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10f0 <atol@plt>
mov    %rax,-0x98(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    14f7 <main+0x2f7>
mov    $0x3,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
lea    0xb59(%rip),%rsi
mov    $0x2,%edx
call   1050 <strncpy@plt>
mov    -0x78(%rbp),%rax
movb   $0x0,0x2(%rax)
cmpq   $0x0,-0x80(%rbp)
je     1571 <main+0x371>
mov    -0x80(%rbp),%rdi
mov    -0x78(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1120 <strptime@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     153b <main+0x33b>
mov    -0x88(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1568 <main+0x368>
mov    0x2a8e(%rip),%rax
mov    (%rax),%edi
lea    0xaf6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <printUsage@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   10c0 <mktime@plt>
cmp    $0xffffffff,%eax
jne    15bf <main+0x3bf>
mov    0x2a37(%rip),%rax
mov    (%rax),%edi
lea    0xaaf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <printUsage@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rdx
mov    $0x50,%esi
lea    -0x20(%rbp),%rcx
call   10d0 <strftime@plt>
lea    -0x70(%rbp),%rsi
lea    0xa7f(%rip),%rdi
call   1080 <printf@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
cmp    $0x2,%edi
jne    1234 <main+0x34>
mov    0x8(%rbp),%rax
cmpb   $0x2d,(%rax)
jne    1234 <main+0x34>
mov    0x1(%rax),%al
cmp    $0x76,%al
je     145e <main+0x25e>
cmp    $0x68,%al
je     1475 <main+0x275>
lea    -0x1(%rbx),%r14d
mov    0x2da1(%rip),%rax
cmp    (%rax),%r14d
jne    1257 <main+0x57>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    1315 <main+0x115>
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    0x2d93(%rip),%r13
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    %rbp,%r15
jmp    12c3 <main+0xc3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13),%rdi
call   1070 <strlen@plt>
mov    %eax,%ebp
lea    0x1(%rbp),%edi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    0x0(%r13),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <strncpy@plt>
mov    %r12,%rax
mov    %r12,0x10(%rsp)
movslq %ebp,%rax
movb   $0x0,(%r12,%rax,1)
mov    0x2d25(%rip),%rax
cmp    (%rax),%r14d
mov    %r15,%rbp
je     1315 <main+0x115>
mov    %ebx,%edi
mov    %rbp,%rsi
lea    0xd42(%rip),%rdx
call   1100 <getopt@plt>
cmp    $0x66,%eax
je     1280 <main+0x80>
cmp    $0x73,%eax
jne    130c <main+0x10c>
mov    0x0(%r13),%rdi
call   1070 <strlen@plt>
mov    %eax,%ebp
lea    0x1(%rbp),%edi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    0x0(%r13),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <strncpy@plt>
mov    %r12,%rax
mov    %r12,0x8(%rsp)
jmp    12ac <main+0xac>
cmp    $0xffffffff,%eax
jne    144b <main+0x24b>
movslq %r14d,%rbx
mov    0x0(%rbp,%rbx,8),%rdi
call   1060 <isinteger@plt>
test   %eax,%eax
je     1416 <main+0x216>
mov    0x0(%rbp,%rbx,8),%rdi
call   10f0 <atol@plt>
mov    %rax,%r14
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,0x1c(%rsp)
lea    0x1c(%rsp),%rdi
call   1040 <localtime@plt>
mov    (%rax),%rax
mov    %rax,(%rsp)
mov    0x10(%rsp),%rbx
test   %rbx,%rbx
mov    0x8(%rsp),%r15
je     1369 <main+0x169>
test   %r15,%r15
jne    1393 <main+0x193>
jmp    13b3 <main+0x1b3>
mov    $0x3,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbx
lea    0xcc1(%rip),%rsi
mov    %rax,%rdi
mov    $0x2,%edx
call   1050 <strncpy@plt>
movb   $0x0,0x2(%rbx)
test   %r15,%r15
je     13b3 <main+0x1b3>
mov    %rsp,%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1120 <strptime@plt>
test   %rax,%rax
je     1404 <main+0x204>
cmpb   $0x0,(%rax)
jne    1404 <main+0x204>
mov    %r15,%rdi
call   1030 <free@plt>
add    %r14,(%rsp)
mov    %rsp,%rdi
call   10c0 <mktime@plt>
cmp    $0xffffffff,%eax
je     1434 <main+0x234>
lea    0x20(%rsp),%rbp
mov    %rsp,%rcx
mov    %rbp,%rdi
mov    $0x50,%esi
mov    %rbx,%rdx
call   10d0 <strftime@plt>
lea    0xc7c(%rip),%rdi
mov    %rbp,%rsi
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bc5(%rip),%rax
mov    (%rax),%edi
lea    0xc2d(%rip),%rsi
jmp    1444 <main+0x244>
mov    0x2bb3(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp,%rbx,8),%rdx
lea    0xbeb(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    144b <main+0x24b>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
lea    0xc0d(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%rdi
call   10e0 <printUsage@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
mov    0x0(%rbp),%rsi
lea    0xb97(%rip),%rdi
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    0x0(%rbp),%rdi
call   10e0 <printUsage@plt>
xor    %edi,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i64 }
@.str = [17 x i8] c"%s: version 0.8\0A\00"
@optind = global i32 0
@.str.1 = [5 x i8] c"f:s:\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [40 x i8] c"invalid argument, %s is not an integer\0A\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [16 x i8] c"strptime error\0A\00"
@.str.5 = [14 x i8] c"mktime error\0A\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.tm
%8 = alloca [80 x i8]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %9
store i8* null, i8** %10
store i8* null, i8** %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %38
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 45
br i1 %23, label %24, label %38
24: ; preds = %17
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 104
br i1 %31, label %32, label %38
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 @printUsage(i8* %35)
%37 = call i32 @exit(i32 0)
unreachable
38: ; preds = %24, %17, %2
%39 = load i32, i32* %4
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %62
41: ; preds = %38
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 45
br i1 %47, label %48, label %62
48: ; preds = %41
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 118
br i1 %55, label %56, label %62
56: ; preds = %48
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 0
%59 = load i8*, i8** %58
%60 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %59)
%61 = call i32 @exit(i32 0)
unreachable
62: ; preds = %48, %41, %38
br label %63
63: ; preds = %114, %62
%64 = load i32, i32* %4
%65 = sub nsw i32 %64, 1
%66 = load i32, i32* @optind
%67 = icmp ne i32 %65, %66
br i1 %67, label %68, label %73
68: ; preds = %63
%69 = load i32, i32* %4
%70 = load i8**, i8*** %5
%71 = call i32 @getopt(i32 %69, i8** %70, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %71, i32* %12
%72 = icmp ne i32 %71, -1
br label %73
73: ; preds = %68, %63
%74 = phi i1 [ false, %63 ], [ %72, %68 ]
br i1 %74, label %75, label %115
75: ; preds = %73
%76 = load i32, i32* %12
switch i32 %76, label %108 [
i32 102, label %77
i32 115, label %92
i32 63, label %107
]
77: ; preds = %75
%78 = load i8*, i8** @optarg
%79 = call i32 @strlen(i8* %78)
store i32 %79, i32* %13
%80 = load i32, i32* %13
%81 = add nsw i32 %80, 1
%82 = call i64 @malloc(i32 %81)
%83 = inttoptr i64 %82 to i8*
store i8* %83, i8** %9
%84 = load i8*, i8** %9
%85 = load i8*, i8** @optarg
%86 = load i32, i32* %13
%87 = call i32 @strncpy(i8* %84, i8* %85, i32 %86)
%88 = load i8*, i8** %9
%89 = load i32, i32* %13
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
store i8 0, i8* %91
br label %114
92: ; preds = %75
%93 = load i8*, i8** @optarg
%94 = call i32 @strlen(i8* %93)
store i32 %94, i32* %13
%95 = load i32, i32* %13
%96 = add nsw i32 %95, 1
%97 = call i64 @malloc(i32 %96)
%98 = inttoptr i64 %97 to i8*
store i8* %98, i8** %10
%99 = load i8*, i8** %10
%100 = load i8*, i8** @optarg
%101 = load i32, i32* %13
%102 = call i32 @strncpy(i8* %99, i8* %100, i32 %101)
%103 = load i8*, i8** %10
%104 = load i32, i32* %13
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
store i8 0, i8* %106
br label %114
107: ; preds = %75
br label %108
108: ; preds = %75, %107
%109 = load i8**, i8*** %5
%110 = getelementptr inbounds i8*, i8** %109, i64 0
%111 = load i8*, i8** %110
%112 = call i32 @printUsage(i8* %111)
%113 = call i32 @exit(i32 -1)
unreachable
114: ; preds = %92, %77
br label %63
115: ; preds = %73
%116 = load i8**, i8*** %5
%117 = load i32, i32* %4
%118 = sub nsw i32 %117, 1
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8*, i8** %116, i64 %119
%121 = load i8*, i8** %120
%122 = call i32 @isinteger(i8* %121)
%123 = icmp ne i32 %122, 0
br i1 %123, label %138, label %124
124: ; preds = %115
%125 = load i32, i32* @stderr
%126 = load i8**, i8*** %5
%127 = load i32, i32* %4
%128 = sub nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8*, i8** %126, i64 %129
%131 = load i8*, i8** %130
%132 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %131)
%133 = load i8**, i8*** %5
%134 = getelementptr inbounds i8*, i8** %133, i64 0
%135 = load i8*, i8** %134
%136 = call i32 @printUsage(i8* %135)
%137 = call i32 @exit(i32 -1)
unreachable
138: ; preds = %115
%139 = load i8**, i8*** %5
%140 = load i32, i32* %4
%141 = sub nsw i32 %140, 1
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8*, i8** %139, i64 %142
%144 = load i8*, i8** %143
%145 = call i64 @atol(i8* %144)
store i64 %145, i64* %14
%146 = call i32 @time(i32* null)
store i32 %146, i32* %6
%147 = call %struct.tm* @localtime(i32* %6)
%148 = bitcast %struct.tm* %7 to i8*
%149 = bitcast %struct.tm* %147 to i8*
%150 = load i8*, i8** %9
%151 = icmp eq i8* %150, null
br i1 %151, label %152, label %159
152: ; preds = %138
%153 = call i64 @malloc(i32 3)
%154 = inttoptr i64 %153 to i8*
store i8* %154, i8** %9
%155 = load i8*, i8** %9
%156 = call i32 @strncpy(i8* %155, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%157 = load i8*, i8** %9
%158 = getelementptr inbounds i8, i8* %157, i64 2
store i8 0, i8* %158
br label %159
159: ; preds = %152, %138
%160 = load i8*, i8** %10
%161 = icmp ne i8* %160, null
br i1 %161, label %162, label %184
162: ; preds = %159
%163 = load i8*, i8** %10
%164 = load i8*, i8** %9
%165 = call i8* @strptime(i8* %163, i8* %164, %struct.tm* %7)
store i8* %165, i8** %11
%166 = load i8*, i8** %11
%167 = icmp eq i8* %166, null
br i1 %167, label %173, label %168
168: ; preds = %162
%169 = load i8*, i8** %11
%170 = load i8, i8* %169
%171 = sext i8 %170 to i32
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %181
173: ; preds = %168, %162
%174 = load i32, i32* @stderr
%175 = call i32 (i32, i8*, ...) @fprintf(i32 %174, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%176 = load i8**, i8*** %5
%177 = getelementptr inbounds i8*, i8** %176, i64 0
%178 = load i8*, i8** %177
%179 = call i32 @printUsage(i8* %178)
%180 = call i32 @exit(i32 -1)
unreachable
181: ; preds = %168
%182 = load i8*, i8** %10
%183 = call i32 @free(i8* %182)
br label %184
184: ; preds = %181, %159
%185 = load i64, i64* %14
%186 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%187 = load i64, i64* %186
%188 = add nsw i64 %187, %185
store i64 %188, i64* %186
%189 = call i32 @mktime(%struct.tm* %7)
%190 = icmp eq i32 %189, -1
br i1 %190, label %191, label %199
191: ; preds = %184
%192 = load i32, i32* @stderr
%193 = call i32 (i32, i8*, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%194 = load i8**, i8*** %5
%195 = getelementptr inbounds i8*, i8** %194, i64 0
%196 = load i8*, i8** %195
%197 = call i32 @printUsage(i8* %196)
%198 = call i32 @exit(i32 -1)
unreachable
199: ; preds = %184
%200 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%201 = load i8*, i8** %9
%202 = call i32 @strftime(i8* %200, i32 80, i8* %201, %struct.tm* %7)
%203 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%204 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %203)
%205 = load i8*, i8** %9
%206 = call i32 @free(i8* %205)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i64 }
@.str = [17 x i8] c"%s: version 0.8\0A\00"
@optind = global i32 0
@.str.1 = [5 x i8] c"f:s:\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.2 = [40 x i8] c"invalid argument, %s is not an integer\0A\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [16 x i8] c"strptime error\0A\00"
@.str.5 = [14 x i8] c"mktime error\0A\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca %struct.tm
%5 = alloca [80 x i8]
%6 = bitcast i32* %3 to i8*
%7 = bitcast %struct.tm* %4 to i8*
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 2
br i1 %9, label %10, label %26
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 45
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %12, i64 1
%17 = load i8, i8* %16
switch i8 %17, label %26 [
i8 104, label %18
i8 118, label %22
]
18: ; preds = %15
%19 = load i8*, i8** %1
%20 = tail call i32 @printUsage(i8* %19)
%21 = tail call i32 @exit(i32 0)
unreachable
22: ; preds = %15
%23 = load i8*, i8** %1
%24 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = tail call i32 @exit(i32 0)
unreachable
26: ; preds = %15, %10, %2
%27 = add nsw i32 %0, -1
%28 = load i32, i32* @optind
%29 = icmp eq i32 %27, %28
br i1 %29, label %63, label %30
30: ; preds = %26, %54
%31 = phi i8* [ %58, %54 ], [ null, %26 ]
%32 = phi i8* [ %57, %54 ], [ null, %26 ]
%33 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
switch i32 %33, label %50 [
i32 -1, label %63
i32 102, label %34
i32 115, label %42
]
34: ; preds = %30
%35 = load i8*, i8** @optarg
%36 = tail call i32 @strlen(i8* %35)
%37 = add nsw i32 %36, 1
%38 = tail call i64 @malloc(i32 %37)
%39 = inttoptr i64 %38 to i8*
%40 = load i8*, i8** @optarg
%41 = tail call i32 @strncpy(i8* %39, i8* %40, i32 %36)
br label %54
42: ; preds = %30
%43 = load i8*, i8** @optarg
%44 = tail call i32 @strlen(i8* %43)
%45 = add nsw i32 %44, 1
%46 = tail call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to i8*
%48 = load i8*, i8** @optarg
%49 = tail call i32 @strncpy(i8* %47, i8* %48, i32 %44)
br label %54
50: ; preds = %30
%51 = load i8*, i8** %1
%52 = tail call i32 @printUsage(i8* %51)
%53 = tail call i32 @exit(i32 -1)
unreachable
54: ; preds = %42, %34
%55 = phi i32 [ %44, %42 ], [ %36, %34 ]
%56 = phi i8* [ %47, %42 ], [ %39, %34 ]
%57 = phi i8* [ %47, %42 ], [ %32, %34 ]
%58 = phi i8* [ %31, %42 ], [ %39, %34 ]
%59 = sext i32 %55 to i64
%60 = getelementptr inbounds i8, i8* %56, i64 %59
store i8 0, i8* %60
%61 = load i32, i32* @optind
%62 = icmp eq i32 %27, %61
br i1 %62, label %63, label %30
63: ; preds = %54, %30, %26
%64 = phi i8* [ null, %26 ], [ %32, %30 ], [ %57, %54 ]
%65 = phi i8* [ null, %26 ], [ %31, %30 ], [ %58, %54 ]
%66 = sext i32 %27 to i64
%67 = getelementptr inbounds i8*, i8** %1, i64 %66
%68 = load i8*, i8** %67
%69 = tail call i32 @isinteger(i8* %68)
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %78
71: ; preds = %63
%72 = load i32, i32* @stderr
%73 = load i8*, i8** %67
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %73)
%75 = load i8*, i8** %1
%76 = tail call i32 @printUsage(i8* %75)
%77 = tail call i32 @exit(i32 -1)
unreachable
78: ; preds = %63
%79 = load i8*, i8** %67
%80 = tail call i64 @atol(i8* %79)
%81 = tail call i32 @time(i32* null)
store i32 %81, i32* %3
%82 = call %struct.tm* @localtime(i32* %3)
%83 = getelementptr %struct.tm, %struct.tm* %82, i64 0, i32 0
%84 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%85 = load i64, i64* %83
store i64 %85, i64* %84
%86 = icmp eq i8* %65, null
br i1 %86, label %87, label %92
87: ; preds = %78
%88 = call i64 @malloc(i32 3)
%89 = inttoptr i64 %88 to i8*
%90 = call i32 @strncpy(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%91 = getelementptr inbounds i8, i8* %89, i64 2
store i8 0, i8* %91
br label %92
92: ; preds = %87, %78
%93 = phi i8* [ %89, %87 ], [ %65, %78 ]
%94 = icmp eq i8* %64, null
br i1 %94, label %109, label %95
95: ; preds = %92
%96 = call i8* @strptime(i8* %64, i8* %93, %struct.tm* %4)
%97 = icmp eq i8* %96, null
br i1 %97, label %101, label %98
98: ; preds = %95
%99 = load i8, i8* %96
%100 = icmp eq i8 %99, 0
br i1 %100, label %107, label %101
101: ; preds = %98, %95
%102 = load i32, i32* @stderr
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%104 = load i8*, i8** %1
%105 = call i32 @printUsage(i8* %104)
%106 = call i32 @exit(i32 -1)
unreachable
107: ; preds = %98
%108 = call i32 @free(i8* %64)
br label %109
109: ; preds = %107, %92
%110 = load i64, i64* %84
%111 = add nsw i64 %110, %80
store i64 %111, i64* %84
%112 = call i32 @mktime(%struct.tm* %4)
%113 = icmp eq i32 %112, -1
br i1 %113, label %114, label %120
114: ; preds = %109
%115 = load i32, i32* @stderr
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%117 = load i8*, i8** %1
%118 = call i32 @printUsage(i8* %117)
%119 = call i32 @exit(i32 -1)
unreachable
120: ; preds = %109
%121 = call i32 @strftime(i8* %8, i32 80, i8* %93, %struct.tm* %4)
%122 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %8)
%123 = call i32 @free(i8* %93)
ret i32 0
}