#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 scalar_t__ time_t;
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ asctime(int /*<<< orphan*/);
int clock();
double difftime(scalar_t__, scalar_t__);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(scalar_t__ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ time(scalar_t__ *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    printf("Current time is:\n");
    time_t timec;
    time_t timel;
    time(&timec);
    time(&timel);
    char times[128];
    strcpy(times, asctime(localtime(&timec)));
    times[strlen(times) - 1] = '\0';
    printf("%s", times);
    while (1) {
      time(&timec);
      if (timec != timel) {
        timel = timec;
        strcpy(times, asctime(localtime(&timec)));
        times[strlen(times) - 1] = '\0';
        printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
        printf("%s", times);
      }
    }
  }
  if (argc == 2 && strcmp(argv[1], "-t") == 0) {
    double timer;
    unsigned long int min;
    unsigned int sec;
    time_t start;
    time_t current;
    time_t last;
    printf("Enter Minutes:");
    scanf("%lu", &min);
    printf("Enter Seconds to start:");
    scanf("%u", &sec);
    timer = (double)min * 60 + (double)sec;
    time(&start);
    time(&current);
    time(&last);
    printf("\n%u:%u", (unsigned int)timer / 60, (unsigned int)timer % 60);
    while (1) {
      time(&current);
      if (last != current) {
        last = current;
        unsigned int difference = (unsigned int)difftime(current, start);
        printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
        printf("%0u:%02u", ((unsigned int)timer - difference) / 60,
               ((unsigned int)timer - difference) % 60);
      }
      if (difftime(current, start) >= timer) {
        printf("\a");
        while (1) {
          time(&current);
          if (last != current) {
            last = current;
            printf("\a");
          }
        }
      }
    }
  }
  if (argc == 2 && strcmp(argv[1], "-s") == 0) {
    char unused;
    printf("Press ENTER to start:");
    scanf("%c", &unused);
    clock_t start = clock();
    printf("Press ENTER to stop:");
    scanf("%c", &unused);
    clock_t diftime = clock() - start;
    printf("%u:%02u.%02u\n", (unsigned int)(diftime / CLOCKS_PER_SEC / 60),
           (unsigned int)((diftime / CLOCKS_PER_SEC) % 60),
           (unsigned int)((diftime / (CLOCKS_PER_SEC / 100))) % 100);
    exit(EXIT_SUCCESS);
  }
  printf("Simple command line timer. \n-t for timer, -s for stopwatch, and no "
         "argument gives current local time.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    12d9 <main+0x129>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x18(%rbp),%rdi
call   10b0 <time@plt>
lea    -0x20(%rbp),%rdi
call   10b0 <time@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1070 <asctime@plt>
mov    -0xe8(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
lea    -0xa0(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    -0xa0(%rbp),%rsi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x18(%rbp),%rdi
call   10b0 <time@plt>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     12d4 <main+0x124>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1070 <asctime@plt>
mov    -0xf0(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
lea    -0xa0(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xa0(%rbp),%rsi
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    124d <main+0x9d>
cmpl   $0x2,-0x8(%rbp)
jne    1509 <main+0x359>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd66(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1509 <main+0x359>
lea    0xd53(%rip),%rdi
xor    %eax,%eax
mov    %al,-0xf1(%rbp)
call   1080 <printf@plt>
mov    -0xf1(%rbp),%al
lea    0xd48(%rip),%rdi
lea    -0xb0(%rbp),%rsi
call   10c0 <scanf@plt>
mov    -0xf1(%rbp),%al
lea    0xd33(%rip),%rdi
call   1080 <printf@plt>
mov    -0xf1(%rbp),%al
lea    0xd3d(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   10c0 <scanf@plt>
movaps 0xca0(%rip),%xmm1
movq   -0xb0(%rbp),%xmm0
ff
punpckldq %xmm1,%xmm0
movapd 0xc9c(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0xb4(%rbp),%eax
cvtsi2sd %rax,%xmm1
movsd  0xc8a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
lea    -0xc0(%rbp),%rdi
call   10b0 <time@plt>
lea    -0xc8(%rbp),%rdi
call   10b0 <time@plt>
lea    -0xd0(%rbp),%rdi
call   10b0 <time@plt>
cvttsd2si -0xa8(%rbp),%rax
ff ff
mov    %eax,%ecx
mov    $0x88888889,%edx
imul   %rdx,%rcx
shr    $0x25,%rcx
mov    %ecx,%esi
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
lea    0xc92(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc8(%rbp),%rdi
call   10b0 <time@plt>
mov    -0xd0(%rbp),%rax
cmp    -0xc8(%rbp),%rax
je     1494 <main+0x2e4>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0xc8(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
call   1090 <difftime@plt>
cvttsd2si %xmm0,%rax
mov    %eax,-0xd4(%rbp)
lea    0xbef(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
cvttsd2si -0xa8(%rbp),%rax
ff ff
mov    -0xd4(%rbp),%edx
mov    %eax,%ecx
sub    %edx,%ecx
mov    $0x88888889,%edx
imul   %rdx,%rcx
shr    $0x25,%rcx
mov    %ecx,%esi
sub    -0xd4(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xc8(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
call   1090 <difftime@plt>
ucomisd -0xa8(%rbp),%xmm0
ff
jb     1504 <main+0x354>
lea    0xbda(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc8(%rbp),%rdi
call   10b0 <time@plt>
mov    -0xd0(%rbp),%rax
cmp    -0xc8(%rbp),%rax
je     14ff <main+0x34f>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    0xb9e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    14c3 <main+0x313>
jmp    13fb <main+0x24b>
cmpl   $0x2,-0x8(%rbp)
jne    1624 <main+0x474>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xb76(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1624 <main+0x474>
lea    0xb63(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xb6b(%rip),%rdi
lea    -0xd5(%rbp),%rsi
mov    $0x0,%al
call   10c0 <scanf@plt>
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0xdc(%rbp)
lea    0xb4c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xb3b(%rip),%rdi
lea    -0xd5(%rbp),%rsi
mov    $0x0,%al
call   10c0 <scanf@plt>
mov    $0x0,%al
call   1050 <clock@plt>
sub    -0xdc(%rbp),%eax
mov    %eax,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
mov    0x2a44(%rip),%rcx
cltd
idivl  (%rcx)
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xe0(%rbp),%eax
mov    0x2a2a(%rip),%rcx
cltd
idivl  (%rcx)
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xf8(%rbp)
mov    -0xe0(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    0x2a06(%rip),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xfc(%rbp),%eax
cltd
idiv   %ecx
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    -0xf8(%rbp),%edx
lea    0xaba(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x29bb(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    0xaac(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x299f(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
cmp    $0x2,%edi
je     12ac <main+0xdc>
cmp    $0x1,%edi
jne    1524 <main+0x354>
lea    0xf2f(%rip),%rdi
call   1060 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <time@plt>
mov    %rsp,%rdi
call   10d0 <time@plt>
mov    %rbx,%rdi
call   1040 <localtime@plt>
mov    %eax,%edi
call   1090 <asctime@plt>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <strcpy@plt>
mov    %r14,%rdi
call   1080 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
lea    0xddf(%rip),%r15
lea    0xddb(%rip),%r12
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
nopl   (%rax)
mov    %rbx,%rdi
call   10d0 <time@plt>
mov    0x10(%rsp),%rax
cmp    (%rsp),%rax
je     1260 <main+0x90>
mov    %rax,(%rsp)
mov    %rbx,%rdi
call   1040 <localtime@plt>
mov    %eax,%edi
call   1090 <asctime@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <strcpy@plt>
mov    %r14,%rdi
call   1080 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
mov    %r12,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1250 <main+0x80>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xd8c(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    144a <main+0x27a>
lea    0xd7a(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd7b(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
lea    0xd6c(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd7a(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
movsd  0x30(%rsp),%xmm0
unpcklps 0xce9(%rip),%xmm0
subpd  0xcf1(%rip),%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
mov    0x1c(%rsp),%eax
cvtsi2sd %rax,%xmm1
addsd  %xmm0,%xmm2
mulsd  0xce4(%rip),%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,0x20(%rsp)
lea    0x10(%rsp),%rdi
call   10d0 <time@plt>
mov    %rsp,%r13
mov    %r13,%rdi
call   10d0 <time@plt>
lea    0x8(%rsp),%rdi
call   10d0 <time@plt>
cvttsd2si 0x20(%rsp),%rbp
mov    %ebp,%esi
mov    $0x88888889,%r12d
imul   %r12,%rsi
shr    $0x25,%rsi
imul   $0x3c,%esi,%eax
mov    %ebp,%edx
sub    %eax,%edx
lea    0xcea(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xc93(%rip),%r14
lea    0xcdc(%rip),%r15
jmp    13c2 <main+0x1f2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rsi
call   10b0 <difftime@plt>
ucomisd 0x20(%rsp),%xmm0
jae    141d <main+0x24d>
mov    %r13,%rdi
call   10d0 <time@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rax
cmp    %rax,%rdi
je     13b0 <main+0x1e0>
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rsi
mov    %rax,%rdi
call   10b0 <difftime@plt>
cvttsd2si %xmm0,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %ebp,%edx
sub    %ebx,%edx
mov    %rdx,%rsi
imul   %r12,%rsi
shr    $0x25,%rsi
imul   $0x3c,%esi,%eax
sub    %eax,%edx
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rsp),%rdi
jmp    13b0 <main+0x1e0>
mov    %rsp,%rbx
mov    $0x7,%edi
call   1030 <putchar@plt>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   10d0 <time@plt>
mov    (%rsp),%rax
cmp    %rax,0x8(%rsp)
je     1430 <main+0x260>
mov    %rax,0x8(%rsp)
jmp    1420 <main+0x250>
mov    0x8(%rbx),%rdi
lea    0xc2f(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    1524 <main+0x354>
lea    0xc1d(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xc25(%rip),%rbx
lea    0x30(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
xor    %eax,%eax
call   1070 <clock@plt>
mov    %eax,%ebp
lea    0xc06(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10e0 <scanf@plt>
xor    %eax,%eax
call   1070 <clock@plt>
mov    %eax,%edi
sub    %ebp,%edi
mov    0x2b28(%rip),%rax
movslq (%rax),%rbp
mov    %edi,%eax
cltd
idiv   %ebp
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rsi
shr    $0x20,%rsi
add    %ecx,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x5,%esi
add    %eax,%esi
imul   $0x3c,%esi,%eax
sub    %eax,%ecx
imul   $0x51eb851f,%rbp,%rbp
mov    %rbp,%rax
shr    $0x3f,%rax
sar    $0x25,%rbp
add    %eax,%ebp
mov    %edi,%eax
cltd
idiv   %ebp
imul   $0x51eb851f,%rax,%rdx
shr    $0x25,%rdx
imul   $0x64,%edx,%edx
sub    %edx,%eax
lea    0xb9e(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1530 <main+0x360>
lea    0xb98(%rip),%rdi
call   1060 <puts@plt>
mov    0x2aa1(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Current time is:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\00"
@.str.3 = [3 x i8] c"-t\00"
@.str.4 = [15 x i8] c"Enter Minutes:\00"
@.str.5 = [4 x i8] c"%lu\00"
@.str.6 = [24 x i8] c"Enter Seconds to start:\00"
@.str.7 = [3 x i8] c"%u\00"
@.str.8 = [7 x i8] c"\0A%u:%u\00"
@.str.9 = [9 x i8] c"%0u:%02u\00"
@.str.10 = [2 x i8] c"\07\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [22 x i8] c"Press ENTER to start:\00"
@.str.13 = [3 x i8] c"%c\00"
@.str.14 = [21 x i8] c"Press ENTER to stop:\00"
@.str.15 = [14 x i8] c"%u:%02u.%02u\0A\00"
@CLOCKS_PER_SEC = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.16 = [103 x i8] c"Simple command line timer. \0A-t for timer, -s for stopwatch, and no argument gives current local time.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca [128 x i8]
%9 = alloca double
%10 = alloca i64
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %56
21: ; preds = %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @time(i64* %6)
%24 = call i32 @time(i64* %7)
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%26 = call i32 @localtime(i64* %6)
%27 = call i32 @asctime(i32 %26)
%28 = call i32 @strcpy(i8* %25, i32 %27)
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%30 = call i32 @strlen(i8* %29)
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 %32
store i8 0, i8* %33
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %21, %55
%37 = call i32 @time(i64* %6)
%38 = load i64, i64* %6
%39 = load i64, i64* %7
%40 = icmp ne i64 %38, %39
br i1 %40, label %41, label %55
41: ; preds = %36
%42 = load i64, i64* %6
store i64 %42, i64* %7
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%44 = call i32 @localtime(i64* %6)
%45 = call i32 @asctime(i32 %44)
%46 = call i32 @strcpy(i8* %43, i32 %45)
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 %50
store i8 0, i8* %51
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %53)
br label %55
55: ; preds = %41, %36
br label %36
56: ; preds = %2
%57 = load i32, i32* %4
%58 = icmp eq i32 %57, 2
br i1 %58, label %59, label %126
59: ; preds = %56
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %126
65: ; preds = %59
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64* %10)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%69 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %11)
%70 = load i64, i64* %10
%71 = uitofp i64 %70 to double
%72 = load i32, i32* %11
%73 = uitofp i32 %72 to double
%74 = call double @llvm.fmuladd.f64(double %71, double 6.000000e+01, double %73)
store double %74, double* %9
%75 = call i32 @time(i64* %12)
%76 = call i32 @time(i64* %13)
%77 = call i32 @time(i64* %14)
%78 = load double, double* %9
%79 = fptoui double %78 to i32
%80 = udiv i32 %79, 60
%81 = load double, double* %9
%82 = fptoui double %81 to i32
%83 = urem i32 %82, 60
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %80, i32 %83)
br label %85
85: ; preds = %65, %125
%86 = call i32 @time(i64* %13)
%87 = load i64, i64* %14
%88 = load i64, i64* %13
%89 = icmp ne i64 %87, %88
br i1 %89, label %90, label %108
90: ; preds = %85
%91 = load i64, i64* %13
store i64 %91, i64* %14
%92 = load i64, i64* %13
%93 = load i64, i64* %12
%94 = call double @difftime(i64 %92, i64 %93)
%95 = fptoui double %94 to i32
store i32 %95, i32* %15
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%97 = load double, double* %9
%98 = fptoui double %97 to i32
%99 = load i32, i32* %15
%100 = sub i32 %98, %99
%101 = udiv i32 %100, 60
%102 = load double, double* %9
%103 = fptoui double %102 to i32
%104 = load i32, i32* %15
%105 = sub i32 %103, %104
%106 = urem i32 %105, 60
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %101, i32 %106)
br label %108
108: ; preds = %90, %85
%109 = load i64, i64* %13
%110 = load i64, i64* %12
%111 = call double @difftime(i64 %109, i64 %110)
%112 = load double, double* %9
%113 = fcmp oge double %111, %112
br i1 %113, label %114, label %125
114: ; preds = %108
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %116
116: ; preds = %114, %124
%117 = call i32 @time(i64* %13)
%118 = load i64, i64* %14
%119 = load i64, i64* %13
%120 = icmp ne i64 %118, %119
br i1 %120, label %121, label %124
121: ; preds = %116
%122 = load i64, i64* %13
store i64 %122, i64* %14
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %124
124: ; preds = %121, %116
br label %116
125: ; preds = %108
br label %85
126: ; preds = %59, %56
%127 = load i32, i32* %4
%128 = icmp eq i32 %127, 2
br i1 %128, label %129, label %160
129: ; preds = %126
%130 = load i8**, i8*** %5
%131 = getelementptr inbounds i8*, i8** %130, i64 1
%132 = load i8*, i8** %131
%133 = call i64 @strcmp(i8* %132, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %160
135: ; preds = %129
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
%137 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %16)
%138 = call i32 (...) @clock()
store i32 %138, i32* %17
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
%140 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %16)
%141 = call i32 (...) @clock()
%142 = load i32, i32* %17
%143 = sub nsw i32 %141, %142
store i32 %143, i32* %18
%144 = load i32, i32* %18
%145 = load i32, i32* @CLOCKS_PER_SEC
%146 = sdiv i32 %144, %145
%147 = sdiv i32 %146, 60
%148 = load i32, i32* %18
%149 = load i32, i32* @CLOCKS_PER_SEC
%150 = sdiv i32 %148, %149
%151 = srem i32 %150, 60
%152 = load i32, i32* %18
%153 = load i32, i32* @CLOCKS_PER_SEC
%154 = sdiv i32 %153, 100
%155 = sdiv i32 %152, %154
%156 = urem i32 %155, 100
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %147, i32 %151, i32 %156)
%158 = load i32, i32* @EXIT_SUCCESS
%159 = call i32 @exit(i32 %158)
unreachable
160: ; preds = %129, %126
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.16, i64 0, i64 0))
%162 = load i32, i32* @EXIT_SUCCESS
%163 = call i32 @exit(i32 %162)
unreachable
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\08\00"
@.str.3 = [3 x i8] c"-t\00"
@.str.4 = [15 x i8] c"Enter Minutes:\00"
@.str.5 = [4 x i8] c"%lu\00"
@.str.6 = [24 x i8] c"Enter Seconds to start:\00"
@.str.7 = [3 x i8] c"%u\00"
@.str.8 = [7 x i8] c"\0A%u:%u\00"
@.str.9 = [9 x i8] c"%0u:%02u\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [22 x i8] c"Press ENTER to start:\00"
@.str.13 = [3 x i8] c"%c\00"
@.str.14 = [21 x i8] c"Press ENTER to stop:\00"
@.str.15 = [14 x i8] c"%u:%02u.%02u\0A\00"
@CLOCKS_PER_SEC = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [102 x i8] c"Simple command line timer. \0A-t for timer, -s for stopwatch, and no argument gives current local time.\00"
@str.17 = [17 x i8] c"Current time is:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [128 x i8]
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i8
switch i32 %0, label %119 [
i32 1, label %12
i32 2, label %42
]
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.17, i64 0, i64 0))
%14 = bitcast i64* %3 to i8*
%15 = bitcast i64* %4 to i8*
%16 = call i32 @time(i64* %3)
%17 = call i32 @time(i64* %4)
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%19 = call i32 @localtime(i64* %3)
%20 = call i32 @asctime(i32 %19)
%21 = call i32 @strcpy(i8* %18, i32 %20)
%22 = call i32 @strlen(i8* %18)
%23 = add nsw i32 %22, -1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %12, %33
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %28
28: ; preds = %26, %28
%29 = call i32 @time(i64* %3)
%30 = load i64, i64* %3
%31 = load i64, i64* %4
%32 = icmp eq i64 %30, %31
br i1 %32, label %28, label %33
33: ; preds = %28
store i64 %30, i64* %4
%34 = call i32 @localtime(i64* %3)
%35 = call i32 @asctime(i32 %34)
%36 = call i32 @strcpy(i8* %18, i32 %35)
%37 = call i32 @strlen(i8* %18)
%38 = add nsw i32 %37, -1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %39
store i8 0, i8* %40
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %26
42: ; preds = %2
%43 = getelementptr inbounds i8*, i8** %1, i64 1
%44 = load i8*, i8** %43
%45 = tail call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %97
47: ; preds = %42
%48 = bitcast i64* %6 to i8*
%49 = bitcast i32* %7 to i8*
%50 = bitcast i64* %8 to i8*
%51 = bitcast i64* %9 to i8*
%52 = bitcast i64* %10 to i8*
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64* %6)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%56 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %7)
%57 = load i64, i64* %6
%58 = uitofp i64 %57 to double
%59 = load i32, i32* %7
%60 = uitofp i32 %59 to double
%61 = call double @llvm.fmuladd.f64(double %58, double 6.000000e+01, double %60)
%62 = call i32 @time(i64* %8)
%63 = call i32 @time(i64* %9)
%64 = call i32 @time(i64* %10)
%65 = fptoui double %61 to i32
%66 = udiv i32 %65, 60
%67 = urem i32 %65, 60
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %66, i32 %67)
br label %69
69: ; preds = %84, %47
%70 = call i32 @time(i64* %9)
%71 = load i64, i64* %10
%72 = load i64, i64* %9
%73 = icmp eq i64 %71, %72
br i1 %73, label %84, label %74
74: ; preds = %69
store i64 %72, i64* %10
%75 = load i64, i64* %8
%76 = call double @difftime(i64 %72, i64 %75)
%77 = fptoui double %76 to i32
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%79 = sub i32 %65, %77
%80 = udiv i32 %79, 60
%81 = urem i32 %79, 60
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %80, i32 %81)
%83 = load i64, i64* %9
br label %84
84: ; preds = %74, %69
%85 = phi i64 [ %83, %74 ], [ %71, %69 ]
%86 = load i64, i64* %8
%87 = call double @difftime(i64 %85, i64 %86)
%88 = fcmp ult double %87, %61
br i1 %88, label %69, label %89
89: ; preds = %84, %96
%90 = call i32 @putchar(i32 7)
br label %91
91: ; preds = %89, %91
%92 = call i32 @time(i64* %9)
%93 = load i64, i64* %10
%94 = load i64, i64* %9
%95 = icmp eq i64 %93, %94
br i1 %95, label %91, label %96
96: ; preds = %91
store i64 %94, i64* %10
br label %89
97: ; preds = %42
%98 = load i8*, i8** %43
%99 = tail call i64 @strcmp(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %119
101: ; preds = %97
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0))
%103 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %11)
%104 = call i32 (...) @clock()
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
%106 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %11)
%107 = call i32 (...) @clock()
%108 = sub nsw i32 %107, %104
%109 = load i32, i32* @CLOCKS_PER_SEC
%110 = sdiv i32 %108, %109
%111 = sdiv i32 %110, 60
%112 = srem i32 %110, 60
%113 = sdiv i32 %109, 100
%114 = sdiv i32 %108, %113
%115 = urem i32 %114, 100
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %111, i32 %112, i32 %115)
%117 = load i32, i32* @EXIT_SUCCESS
%118 = call i32 @exit(i32 %117)
unreachable
119: ; preds = %2, %97
%120 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @str, i64 0, i64 0))
%121 = load i32, i32* @EXIT_SUCCESS
%122 = tail call i32 @exit(i32 %121)
unreachable
}