#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sleep(int);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
main(int argc, char **argv) {
  int secs;
  if (argc != 2) {
    fprintf(stderr, "Usage is: %s <seconds>\n", argv[0]);
    exit(1);
  }
  if (sscanf(argv[1], "%d", &secs) != 1) {
    fprintf(stderr, "Invalid number: %s\n", argv[1]);
    exit(1);
  }
  (void)sleep(secs);
  exit(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     1186 <main+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe83(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     11ce <main+0x8e>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe5c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1177 <main+0x37>
mov    0x8(%rbx),%rdi
lea    0xec0(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    118c <main+0x4c>
mov    0xc(%rsp),%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe76(%rip),%rsi
jmp    11a0 <main+0x60>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xe7b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage is: %s <seconds>\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Invalid number: %s\0A\00"
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
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%21 = icmp ne i32 %20, 1
br i1 %21, label %22, label %29
22: ; preds = %16
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %16
%30 = load i32, i32* %6
%31 = call i32 @sleep(i32 %30)
%32 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage is: %s <seconds>\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Invalid number: %s\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 %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%15 = icmp eq i32 %14, 1
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %12
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %11
%22 = load i32, i32* %3
%23 = call i32 @sleep(i32 %22)
%24 = call i32 @exit(i32 0)
unreachable
}