#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 dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int getopt(int, char **, char *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  time_t stamp;
  struct tm *tm;
  char timestr[1024];
  char fmt[1024] = {'\0'};
  int ch;
  FILE *fp = stdout;
  stamp = time(NULL);
  tm = localtime(&stamp);
  while (1) {
    ch = getopt(argc, argv, "-y:mdH:MS");
    if (ch < 0)
      break;
    switch (ch) {
    case 1:
      if (fp == stdout) {
        fp = fopen(argv[optind - 1], "w");
        if (fp == NULL) {
          perror("fopen()");
          fp = stdout;
        }
      }
      break;
    case 'y':
      if (strcmp(optarg, "2") == 0)
        strncat(fmt, "%y ", 1024);
      else if (strcmp(optarg, "4") == 0)
        strncat(fmt, "%Y ", 1024);
      else
        fprintf(stderr, "Invalid argument of -y\n");
      break;
    case 'm':
      strncat(fmt, "%m ", 1024);
      break;
    case 'd':
      strncat(fmt, "%d ", 1024);
      break;
    case 'H':
      if (strcmp(optarg, "12") == 0)
        strncat(fmt, "%I(%P) ", 1024);
      else if (strcmp(optarg, "24") == 0)
        strncat(fmt, "%H ", 1024);
      else
        fprintf(stderr, "Invalid argument of -y\n");
      break;
    case 'M':
      strncat(fmt, "%M ", 1024);
      break;
    case 'S':
      strncat(fmt, "%S ", 1024);
      break;
    default:
      break;
    }
  }
  strncat(fmt, "\n", 1024);
  strftime(timestr, 1024, fmt, tm);
  fputs(timestr, fp);
  if (fp != stdout)
    fclose(fp);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x840,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x820(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x830(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdcc(%rip),%rdx
call   10e0 <getopt@plt>
mov    %eax,-0x824(%rbp)
cmpl   $0x0,-0x824(%rbp)
jge    1251 <main+0x81>
jmp    1501 <main+0x331>
mov    -0x824(%rbp),%eax
mov    %eax,-0x834(%rbp)
sub    $0x1,%eax
je     12e3 <main+0x113>
jmp    126b <main+0x9b>
mov    -0x834(%rbp),%eax
sub    $0x48,%eax
je     1428 <main+0x258>
jmp    127f <main+0xaf>
mov    -0x834(%rbp),%eax
sub    $0x4d,%eax
je     14bd <main+0x2ed>
jmp    1293 <main+0xc3>
mov    -0x834(%rbp),%eax
sub    $0x53,%eax
je     14da <main+0x30a>
jmp    12a7 <main+0xd7>
mov    -0x834(%rbp),%eax
sub    $0x64,%eax
je     140b <main+0x23b>
jmp    12bb <main+0xeb>
mov    -0x834(%rbp),%eax
sub    $0x6d,%eax
je     13ee <main+0x21e>
jmp    12cf <main+0xff>
mov    -0x834(%rbp),%eax
sub    $0x79,%eax
je     1359 <main+0x189>
jmp    14f7 <main+0x327>
mov    -0x830(%rbp),%rax
mov    0x2cd7(%rip),%rcx
cmp    (%rcx),%rax
jne    1354 <main+0x184>
mov    -0x10(%rbp),%rax
mov    0x2cdb(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcf2(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x830(%rbp)
cmpq   $0x0,-0x830(%rbp)
jne    134f <main+0x17f>
lea    0xcd3(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c83(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x830(%rbp)
jmp    1354 <main+0x184>
jmp    14fc <main+0x32c>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
lea    0xcd4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1394 <main+0x1c4>
lea    -0x820(%rbp),%rdi
lea    0xc8f(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    13e9 <main+0x219>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
lea    0xca4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    13cf <main+0x1ff>
lea    -0x820(%rbp),%rdi
lea    0xc58(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    13e4 <main+0x214>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    0xc3d(%rip),%rsi
call   1090 <fprintf@plt>
jmp    13e9 <main+0x219>
jmp    14fc <main+0x32c>
lea    -0x820(%rbp),%rdi
lea    0xc38(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    14fc <main+0x32c>
lea    -0x820(%rbp),%rdi
lea    0xc1f(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    14fc <main+0x32c>
mov    0x2bc9(%rip),%rax
mov    (%rax),%edi
lea    0xc04(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1463 <main+0x293>
lea    -0x820(%rbp),%rdi
lea    0xbeb(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    14b8 <main+0x2e8>
mov    0x2b8e(%rip),%rax
mov    (%rax),%edi
lea    0xbd4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    149e <main+0x2ce>
lea    -0x820(%rbp),%rdi
lea    0xbbb(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    14b3 <main+0x2e3>
mov    0x2b2b(%rip),%rax
mov    (%rax),%edi
lea    0xb6e(%rip),%rsi
call   1090 <fprintf@plt>
jmp    14b8 <main+0x2e8>
jmp    14fc <main+0x32c>
lea    -0x820(%rbp),%rdi
lea    0xb83(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    14fc <main+0x32c>
lea    -0x820(%rbp),%rdi
lea    0xb6a(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
jmp    14fc <main+0x32c>
jmp    14fc <main+0x32c>
jmp    1226 <main+0x56>
lea    -0x820(%rbp),%rdi
lea    0xb23(%rip),%rsi
mov    $0x400,%edx
call   1070 <strncat@plt>
lea    -0x420(%rbp),%rdi
lea    -0x820(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x400,%esi
call   10b0 <strftime@plt>
lea    -0x420(%rbp),%rdi
mov    -0x830(%rbp),%rsi
call   1050 <fputs@plt>
mov    -0x830(%rbp),%rax
mov    0x2a72(%rip),%rcx
cmp    (%rcx),%rax
je     156b <main+0x39b>
mov    -0x830(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x828,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x20(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,0x14(%rsp)
lea    0x14(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,0x18(%rsp)
lea    0xea1(%rip),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   10e0 <getopt@plt>
test   %eax,%eax
jns    1296 <main+0xc6>
lea    0xebe(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%edx
call   1070 <strncat@plt>
lea    0x420(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
mov    0x18(%rsp),%rcx
call   10b0 <strftime@plt>
mov    %rbp,%rdi
mov    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <fputs@plt>
mov    0x2d46(%rip),%rax
cmp    (%rax),%rbx
je     128f <main+0xbf>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xe2b(%rip),%r15
lea    0xd5c(%rip),%r13
mov    0x2d4d(%rip),%r14
lea    0x20(%rsp),%r12
jmp    12df <main+0x10f>
mov    %r12,%rdi
lea    0xe5e(%rip),%rsi
nopl   0x0(%rax)
mov    $0x400,%edx
call   1070 <strncat@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   10e0 <getopt@plt>
test   %eax,%eax
js     1235 <main+0x65>
lea    -0x48(%rax),%ecx
cmp    $0x31,%ecx
ja     132b <main+0x15b>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    (%r14),%edi
lea    0xe09(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     13f7 <main+0x227>
mov    (%r14),%edi
lea    0xdfd(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    13dd <main+0x20d>
mov    %r12,%rdi
lea    0xde9(%rip),%rsi
jmp    12c0 <main+0xf0>
cmp    $0x1,%eax
jne    12ca <main+0xfa>
mov    0x2c91(%rip),%rax
mov    0x8(%rsp),%rcx
cmp    (%rax),%rcx
jne    12ca <main+0xfa>
mov    0x2c98(%rip),%rax
movslq (%rax),%rax
mov    -0x8(%rbx,%rax,8),%rdi
lea    0xd7b(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    12ca <main+0xfa>
lea    0xd63(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c4b(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x8(%rsp)
jmp    12ca <main+0xfa>
mov    %r12,%rdi
lea    0xd82(%rip),%rsi
jmp    12c0 <main+0xf0>
mov    %r12,%rdi
lea    0xd5d(%rip),%rsi
jmp    12c0 <main+0xf0>
mov    %r12,%rdi
lea    0xd4a(%rip),%rsi
jmp    12c0 <main+0xf0>
mov    (%r14),%edi
lea    0xd44(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1406 <main+0x236>
mov    (%r14),%edi
lea    0xd3c(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1415 <main+0x245>
mov    0x2bec(%rip),%rax
mov    (%rax),%edi
lea    0xcf7(%rip),%rsi
call   1090 <fprintf@plt>
jmp    12ca <main+0xfa>
mov    %r12,%rdi
lea    0xd06(%rip),%rsi
jmp    12c0 <main+0xf0>
mov    %r12,%rdi
lea    0xccc(%rip),%rsi
jmp    12c0 <main+0xf0>
mov    %r12,%rdi
lea    0xcc1(%rip),%rsi
jmp    12c0 <main+0xf0>

LLVM IR (-O0):
%struct.tm = type { i32 }
@stdout = global i32* null
@.str = [10 x i8] c"-y:mdH:MS\00"
@optind = global i32 0
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [8 x i8] c"fopen()\00"
@optarg = global i32 0
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [4 x i8] c"%y \00"
@.str.5 = [2 x i8] c"4\00"
@.str.6 = [4 x i8] c"%Y \00"
@stderr = global i32 0
@.str.7 = [24 x i8] c"Invalid argument of -y\0A\00"
@.str.8 = [4 x i8] c"%m \00"
@.str.9 = [4 x i8] c"%d \00"
@.str.10 = [3 x i8] c"12\00"
@.str.11 = [8 x i8] c"%I(%P) \00"
@.str.12 = [3 x i8] c"24\00"
@.str.13 = [4 x i8] c"%H \00"
@.str.14 = [4 x i8] c"%M \00"
@.str.15 = [4 x i8] c"%S \00"
@.str.16 = [2 x i8] c"\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 [1024 x i8]
%9 = alloca [1024 x i8]
%10 = alloca i32
%11 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [1024 x i8]* %9 to i8*
%13 = load i32*, i32** @stdout
store i32* %13, i32** %11
%14 = call i32 @time(i32* null)
store i32 %14, i32* %6
%15 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %15, %struct.tm** %7
br label %16
16: ; preds = %2, %95
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
br label %96
23: ; preds = %16
%24 = load i32, i32* %10
switch i32 %24, label %94 [
i32 1, label %25
i32 121, label %44
i32 109, label %63
i32 100, label %66
i32 72, label %69
i32 77, label %88
i32 83, label %91
]
25: ; preds = %23
%26 = load i32*, i32** %11
%27 = load i32*, i32** @stdout
%28 = icmp eq i32* %26, %27
br i1 %28, label %29, label %43
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = load i32, i32* @optind
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %30, i64 %33
%35 = load i8*, i8** %34
%36 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %36, i32** %11
%37 = load i32*, i32** %11
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %42
39: ; preds = %29
%40 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32*, i32** @stdout
store i32* %41, i32** %11
br label %42
42: ; preds = %39, %29
br label %43
43: ; preds = %42, %25
br label %95
44: ; preds = %23
%45 = load i32, i32* @optarg
%46 = call i32 @strcmp(i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%50 = call i32 @strncat(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 1024)
br label %62
51: ; preds = %44
%52 = load i32, i32* @optarg
%53 = call i32 @strcmp(i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%57 = call i32 @strncat(i8* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 1024)
br label %61
58: ; preds = %51
%59 = load i32, i32* @stderr
%60 = call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %61
61: ; preds = %58, %55
br label %62
62: ; preds = %61, %48
br label %95
63: ; preds = %23
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%65 = call i32 @strncat(i8* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 1024)
br label %95
66: ; preds = %23
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%68 = call i32 @strncat(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 1024)
br label %95
69: ; preds = %23
%70 = load i32, i32* @optarg
%71 = call i32 @strcmp(i32 %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%75 = call i32 @strncat(i8* %74, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 1024)
br label %87
76: ; preds = %69
%77 = load i32, i32* @optarg
%78 = call i32 @strcmp(i32 %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%82 = call i32 @strncat(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 1024)
br label %86
83: ; preds = %76
%84 = load i32, i32* @stderr
%85 = call i32 @fprintf(i32 %84, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %86
86: ; preds = %83, %80
br label %87
87: ; preds = %86, %73
br label %95
88: ; preds = %23
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%90 = call i32 @strncat(i8* %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 1024)
br label %95
91: ; preds = %23
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%93 = call i32 @strncat(i8* %92, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 1024)
br label %95
94: ; preds = %23
br label %95
95: ; preds = %94, %91, %88, %87, %66, %63, %62, %43
br label %16
96: ; preds = %22
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%98 = call i32 @strncat(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i32 1024)
%99 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%100 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%101 = load %struct.tm*, %struct.tm** %7
%102 = call i32 @strftime(i8* %99, i32 1024, i8* %100, %struct.tm* %101)
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%104 = load i32*, i32** %11
%105 = call i32 @fputs(i8* %103, i32* %104)
%106 = load i32*, i32** %11
%107 = load i32*, i32** @stdout
%108 = icmp ne i32* %106, %107
br i1 %108, label %109, label %112
109: ; preds = %96
%110 = load i32*, i32** %11
%111 = call i32 @fclose(i32* %110)
br label %112
112: ; preds = %109, %96
%113 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@stdout = global i32* null
@.str = [10 x i8] c"-y:mdH:MS\00"
@optind = global i32 0
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [8 x i8] c"fopen()\00"
@optarg = global i32 0
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [4 x i8] c"%y \00"
@.str.5 = [2 x i8] c"4\00"
@.str.6 = [4 x i8] c"%Y \00"
@stderr = global i32 0
@.str.7 = [24 x i8] c"Invalid argument of -y\0A\00"
@.str.8 = [4 x i8] c"%m \00"
@.str.9 = [4 x i8] c"%d \00"
@.str.10 = [3 x i8] c"12\00"
@.str.11 = [8 x i8] c"%I(%P) \00"
@.str.12 = [3 x i8] c"24\00"
@.str.13 = [4 x i8] c"%H \00"
@.str.14 = [4 x i8] c"%M \00"
@.str.15 = [4 x i8] c"%S \00"
@.str.16 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = load i32*, i32** @stdout
%10 = tail call i32 @time(i32* null)
store i32 %10, i32* %3
%11 = call %struct.tm* @localtime(i32* %3)
%12 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = icmp slt i32 %12, 0
br i1 %13, label %73, label %14
14: ; preds = %2, %69
%15 = phi i32 [ %71, %69 ], [ %12, %2 ]
%16 = phi i32* [ %70, %69 ], [ %9, %2 ]
switch i32 %15, label %69 [
i32 1, label %17
i32 121, label %31
i32 109, label %46
i32 100, label %48
i32 72, label %50
i32 77, label %65
i32 83, label %67
]
17: ; preds = %14
%18 = load i32*, i32** @stdout
%19 = icmp eq i32* %16, %18
br i1 %19, label %20, label %69
20: ; preds = %17
%21 = load i32, i32* @optind
%22 = add nsw i32 %21, -1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %69
28: ; preds = %20
%29 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32*, i32** @stdout
br label %69
31: ; preds = %14
%32 = load i32, i32* @optarg
%33 = call i32 @strcmp(i32 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 1024)
br label %69
37: ; preds = %31
%38 = load i32, i32* @optarg
%39 = call i32 @strcmp(i32 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 1024)
br label %69
43: ; preds = %37
%44 = load i32, i32* @stderr
%45 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %69
46: ; preds = %14
%47 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 1024)
br label %69
48: ; preds = %14
%49 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 1024)
br label %69
50: ; preds = %14
%51 = load i32, i32* @optarg
%52 = call i32 @strcmp(i32 %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32 1024)
br label %69
56: ; preds = %50
%57 = load i32, i32* @optarg
%58 = call i32 @strcmp(i32 %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 1024)
br label %69
62: ; preds = %56
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %69
65: ; preds = %14
%66 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 1024)
br label %69
67: ; preds = %14
%68 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 1024)
br label %69
69: ; preds = %14, %54, %62, %60, %35, %43, %41, %17, %28, %20, %67, %65, %48, %46
%70 = phi i32* [ %16, %14 ], [ %16, %67 ], [ %16, %65 ], [ %16, %54 ], [ %16, %60 ], [ %16, %62 ], [ %16, %48 ], [ %16, %46 ], [ %16, %35 ], [ %16, %41 ], [ %16, %43 ], [ %30, %28 ], [ %26, %20 ], [ %16, %17 ]
%71 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%72 = icmp slt i32 %71, 0
br i1 %72, label %73, label %14
73: ; preds = %69, %2
%74 = phi i32* [ %9, %2 ], [ %70, %69 ]
%75 = call i32 @strncat(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0), i32 1024)
%76 = call i32 @strftime(i8* %7, i32 1024, i8* %8, %struct.tm* %11)
%77 = call i32 @fputs(i8* %7, i32* %74)
%78 = load i32*, i32** @stdout
%79 = icmp eq i32* %74, %78
br i1 %79, label %82, label %80
80: ; preds = %73
%81 = call i32 @fclose(i32* %74)
br label %82
82: ; preds = %80, %73
%83 = call i32 @exit(i32 0)
unreachable
}