#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*/ perror(char *);
int /*<<< orphan*/ stderr;
unsigned long strtoul(char *, char, int);
scalar_t__ usleep(unsigned long);
int main(int argc, char **argv) {
  unsigned long useconds;
  fprintf(stderr, "Micro-seconds:  %s\n", argv[1]);
  useconds = strtoul(argv[1], '\0', 10);
  fprintf(stderr, "Micro-seconds:  %d\n", useconds);
  if (usleep(useconds))
    perror("Usleep");
}


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    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe73(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <usleep@plt>
cmp    $0x0,%rax
je     11c7 <main+0x87>
lea    0xe66(%rip),%rdi
call   1040 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e92(%rip),%r14
mov    (%r14),%edi
mov    0x8(%rsi),%rdx
lea    0xea4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtoul@plt>
mov    %rax,%rbx
mov    (%r14),%edi
lea    0xe94(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <usleep@plt>
test   %rax,%rax
jne    11a1 <main+0x61>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe80(%rip),%rdi
call   1040 <perror@plt>
jmp    1197 <main+0x57>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Micro-seconds: %s\0A\00"
@.str.1 = [20 x i8] c"Micro-seconds: %d\0A\00"
@.str.2 = [7 x i8] c"Usleep\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* @stderr
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strtoul(i8* %14, i8 signext 0, i32 10)
store i64 %15, i64* %6
%16 = load i32, i32* @stderr
%17 = load i64, i64* %6
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %17)
%19 = load i64, i64* %6
%20 = call i64 @usleep(i64 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %2
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Micro-seconds: %s\0A\00"
@.str.1 = [20 x i8] c"Micro-seconds: %d\0A\00"
@.str.2 = [7 x i8] c"Usleep\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = tail call i64 @strtoul(i8* %7, i8 signext 0, i32 10)
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 %8)
%11 = tail call i64 @usleep(i64 %8)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret i32 0
}