#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 */

/* Variables and functions */
int _time(char **);
int _usage();
int getopt(int, char **, char *);
int optind;
int main(int argc, char *argv[]) {
  int o;
  while ((o = getopt(argc, argv, "p")) != -1) {
    if (o == 'p')
      continue;
    return _usage();
  }
  if (optind == argc)
    return _usage();
  return _time(&argv[optind]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1183 <main+0x53>
cmpl   $0x70,-0x14(%rbp)
jne    1174 <main+0x44>
jmp    1146 <main+0x16>
mov    $0x0,%al
call   1030 <_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11c1 <main+0x91>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    11a4 <main+0x74>
mov    $0x0,%al
call   1030 <_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11c1 <main+0x91>
mov    -0x10(%rbp),%rdi
mov    0x2e39(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <_time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec0(%rip),%r14
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0x70,%eax
je     1140 <main+0x10>
cmp    $0xffffffff,%eax
jne    1165 <main+0x35>
mov    0x2e8a(%rip),%rax
movslq (%rax),%rax
cmp    %ebp,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_usage@plt>
lea    (%rbx,%rax,8),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_time@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"p\00"
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @getopt(i32 %8, i8** %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %6
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 112
br i1 %14, label %15, label %16
15: ; preds = %12
br label %7
16: ; preds = %12
%17 = call i32 (...) @_usage()
store i32 %17, i32* %3
br label %30
18: ; preds = %7
%19 = load i32, i32* @optind
%20 = load i32, i32* %4
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (...) @_usage()
store i32 %23, i32* %3
br label %30
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = load i32, i32* @optind
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = call i32 @_time(i8** %28)
store i32 %29, i32* %3
br label %30
30: ; preds = %24, %22, %16
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@.str = [2 x i8] c"p\00"
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
switch i32 %4, label %5 [
i32 -1, label %7
i32 112, label %3
]
5: ; preds = %3
%6 = tail call i32 (...) @_usage()
br label %16
7: ; preds = %3
%8 = load i32, i32* @optind
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 (...) @_usage()
br label %16
12: ; preds = %7
%13 = sext i32 %8 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = tail call i32 @_time(i8** %14)
br label %16
16: ; preds = %12, %10, %5
%17 = phi i32 [ %6, %5 ], [ %11, %10 ], [ %15, %12 ]
ret i32 %17
}