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

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getopt(int, char **, char *);
scalar_t__ optind;
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int ch, secs;
  while ((ch = getopt(argc, argv, "")) != -1)
    switch (ch) {
    case '?':
    default:
      usage();
    }
  argc -= optind;
  argv += optind;
  if (argc != 1)
    usage();
  if ((secs = atoi(*argv)) > 0)
    (void)sleep((u_int)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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11a7 <main+0x57>
mov    -0x14(%rbp),%eax
sub    $0x3f,%eax
jne    119b <main+0x4b>
jmp    1196 <main+0x46>
jmp    119b <main+0x4b>
mov    $0x0,%al
call   1030 <usage@plt>
jmp    1166 <main+0x16>
mov    0x2e3a(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2e26(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11e2 <main+0x92>
mov    $0x0,%al
call   1030 <usage@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jle    1202 <main+0xb2>
mov    -0x18(%rbp),%edi
call   1070 <sleep@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xea0(%rip),%rdx
call   1040 <getopt@plt>
cmp    $0xffffffff,%eax
je     1199 <main+0x49>
lea    0xe8f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <getopt@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x30>
mov    0x2e48(%rip),%rax
mov    (%rax),%r14
sub    %r14d,%ebp
cmp    $0x1,%ebp
je     11b2 <main+0x62>
xor    %eax,%eax
call   1030 <usage@plt>
mov    (%rbx,%r14,8),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
jle    11c6 <main+0x76>
mov    %eax,%edi
call   1070 <sleep@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @getopt(i32 %9, i8** %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %6
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32, i32* %6
switch i32 %14, label %16 [
i32 63, label %15
]
15: ; preds = %13
br label %16
16: ; preds = %13, %15
%17 = call i32 (...) @usage()
br label %18
18: ; preds = %16
br label %8
19: ; preds = %8
%20 = load i64, i64* @optind
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = sub nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %4
%25 = load i64, i64* @optind
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 %25
store i8** %27, i8*** %5
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %19
%31 = call i32 (...) @usage()
br label %32
32: ; preds = %30, %19
%33 = load i8**, i8*** %5
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %7
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i32, i32* %7
%39 = call i32 @sleep(i32 %38)
br label %40
40: ; preds = %37, %32
%41 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @usage()
%7 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
%10 = load i64, i64* @optind
%11 = trunc i64 %10 to i32
%12 = sub i32 %0, %11
%13 = getelementptr inbounds i8*, i8** %1, i64 %10
%14 = icmp eq i32 %12, 1
br i1 %14, label %17, label %15
15: ; preds = %9
%16 = tail call i32 (...) @usage()
br label %17
17: ; preds = %15, %9
%18 = load i8*, i8** %13
%19 = tail call i32 @atoi(i8* %18)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @sleep(i32 %19)
br label %23
23: ; preds = %21, %17
%24 = tail call i32 @exit(i32 0)
unreachable
}