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

/* Variables and functions */
unsigned long long get_process_start_time(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long long);
int sscanf(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  pid_t pid;
  if (argc != 2) {
    usage();
  }
  int ret = sscanf(argv[1], "%d", &pid);
  if (ret != 1) {
    usage();
  }
  unsigned long long st = get_process_start_time(pid);
  printf("%lld\n", st);
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1167 <main+0x27>
mov    $0x0,%al
call   1060 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8a(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     1193 <main+0x53>
mov    $0x0,%al
call   1060 <usage@plt>
mov    -0x14(%rbp),%edi
call   1040 <get_process_start_time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1154 <main+0x14>
xor    %eax,%eax
call   1060 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xea1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     1175 <main+0x35>
xor    %eax,%eax
call   1060 <usage@plt>
mov    0xc(%rsp),%edi
call   1040 <get_process_start_time@plt>
lea    0xe7e(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @usage()
br label %13
13: ; preds = %11, %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = icmp ne i32 %18, 1
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = call i32 (...) @usage()
br label %22
22: ; preds = %20, %13
%23 = load i32, i32* %6
%24 = call i64 @get_process_start_time(i32 %23)
store i64 %24, i64* %8
%25 = load i64, i64* %8
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @usage()
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = icmp eq i32 %11, 1
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 (...) @usage()
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
%17 = call i64 @get_process_start_time(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %17)
ret i32 0
}