#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ help(char *);
int /*<<< orphan*/ printf(char *, unsigned long);
int /*<<< orphan*/ stderr;
unsigned long to_seconds(char *);
int main(int argc, char **argv) {
  if (argc == 1) {
    fprintf(stderr, "Missing argument\n");
    help(argv[0]);
  }
  if (argc > 2) {
    fprintf(stderr, "Too much arguments\n");
    help(argv[0]);
  }
  unsigned long secs = to_seconds(argv[1]);
  printf("%d\n", secs);
}


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   $0x1,-0x8(%rbp)
jne    1181 <main+0x41>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <help@plt>
cmpl   $0x2,-0x8(%rbp)
jle    11ac <main+0x6c>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <help@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <to_seconds@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jne    1152 <main+0x12>
lea    0xeb0(%rip),%rsi
jmp    115e <main+0x1e>
cmp    $0x3,%edi
jl     1174 <main+0x34>
lea    0xeb4(%rip),%rsi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1040 <fprintf@plt>
mov    (%rbx),%rdi
call   1060 <help@plt>
mov    0x8(%rbx),%rdi
call   1050 <to_seconds@plt>
lea    0xea2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Missing argument\0A\00"
@.str.1 = [20 x i8] c"Too much arguments\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @help(i8* %14)
br label %16
16: ; preds = %9, %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %26
19: ; preds = %16
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @help(i8* %24)
br label %26
26: ; preds = %19, %16
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @to_seconds(i8* %29)
store i64 %30, i64* %6
%31 = load i64, i64* %6
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %31)
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Missing argument\0A\00"
@.str.1 = [20 x i8] c"Too much arguments\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 2
br i1 %5, label %6, label %12
6: ; preds = %4, %2
%7 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %4 ]
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* %7)
%10 = load i8*, i8** %1
%11 = tail call i32 @help(i8* %10)
br label %12
12: ; preds = %6, %4
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i64 @to_seconds(i8* %14)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %15)
ret i32 0
}