#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*/ do_sleep(char const *);
int /*<<< orphan*/ isdigit(char const);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ print_version();
int /*<<< orphan*/ printf(char *, char const);
int main(int argc, char **argv) {
  if (argc < 2) {
    print_help();
    return 0;
  }
  const char *arg = argv[1];
  if (!isdigit(*arg)) {
    if (arg[1] == 'v')
      print_version();
    else if (arg[1] == 'h')
      print_help();
    else {
      printf("Unrecognized option %c\n", arg[1]);
    }
    return 1;
  } else
    do_sleep(arg);
}


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)
jge    1183 <main+0x33>
mov    $0x0,%al
call   1070 <print_help@plt>
movl   $0x0,-0x4(%rbp)
jmp    120c <main+0xbc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1203 <main+0xb3>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x76,%eax
jne    11c1 <main+0x71>
mov    $0x0,%al
call   1040 <print_version@plt>
jmp    11f7 <main+0xa7>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    11de <main+0x8e>
mov    $0x0,%al
call   1070 <print_help@plt>
jmp    11f2 <main+0xa2>
mov    -0x18(%rbp),%rax
lea    0xe17(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1050 <printf@plt>
jmp    11f7 <main+0xa7>
movl   $0x1,-0x4(%rbp)
jmp    120c <main+0xbc>
mov    -0x18(%rbp),%rdi
call   1060 <do_sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jg     1161 <main+0x11>
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <print_help@plt>
jmp    117b <main+0x2b>
mov    0x8(%rsi),%rbx
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     117f <main+0x2f>
mov    %rbx,%rdi
call   1060 <do_sleep@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret
mov    0x1(%rbx),%al
cmp    $0x68,%al
je     1198 <main+0x48>
cmp    $0x76,%al
jne    11a6 <main+0x56>
xor    %eax,%eax
call   1040 <print_version@plt>
mov    $0x1,%ebx
jmp    117b <main+0x2b>
xor    %eax,%eax
call   1070 <print_help@plt>
mov    $0x1,%ebx
jmp    117b <main+0x2b>
movsbl %al,%esi
lea    0xe50(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%ebx
jmp    117b <main+0x2b>

LLVM IR (-O0):
@.str = [24 x i8] c"Unrecognized option %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @print_help()
store i32 0, i32* %3
br label %45
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = call i32 @isdigit(i8 signext %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %42, label %19
19: ; preds = %11
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 118
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 (...) @print_version()
br label %41
27: ; preds = %19
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 104
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 (...) @print_help()
br label %40
35: ; preds = %27
%36 = load i8*, i8** %6
%37 = getelementptr inbounds i8, i8* %36, i64 1
%38 = load i8, i8* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 signext %38)
br label %40
40: ; preds = %35, %33
br label %41
41: ; preds = %40, %25
store i32 1, i32* %3
br label %45
42: ; preds = %11
%43 = load i8*, i8** %6
%44 = call i32 @do_sleep(i8* %43)
br label %45
45: ; preds = %9, %41, %42
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [24 x i8] c"Unrecognized option %c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @print_help()
br label %23
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = tail call i32 @isdigit(i8 signext %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
switch i8 %14, label %19 [
i8 118, label %15
i8 104, label %17
]
15: ; preds = %12
%16 = tail call i32 (...) @print_version()
br label %23
17: ; preds = %12
%18 = tail call i32 (...) @print_help()
br label %23
19: ; preds = %12
%20 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 signext %14)
br label %23
21: ; preds = %6
%22 = tail call i32 @do_sleep(i8* %8)
br label %23
23: ; preds = %21, %17, %19, %15, %4
%24 = phi i32 [ 0, %4 ], [ 0, %21 ], [ 1, %17 ], [ 1, %19 ], [ 1, %15 ]
ret i32 %24
}