#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int sleep(int);
int /*<<< orphan*/ stdout;
long strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc == 2) {
    long count = strtol(argv[1], NULL, 0);
    while (count-- > 0)
      puts("0x55,");
    return 0;
  }
  if (argc != 1)
    return 1;
  puts("sleeping");
  fflush(stdout);
  return sleep(60);
}


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)
jne    11ad <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
jle    11a1 <main+0x61>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
jmp    1177 <main+0x37>
movl   $0x0,-0x4(%rbp)
jmp    11ea <main+0xaa>
cmpl   $0x1,-0x8(%rbp)
je     11c3 <main+0x83>
movl   $0x1,-0x4(%rbp)
jmp    11ea <main+0xaa>
lea    0xe3c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x3c,%edi
call   1060 <sleep@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
je     119b <main+0x5b>
mov    $0x1,%r14d
cmp    $0x2,%edi
jne    1192 <main+0x52>
mov    0x8(%rsi),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtol@plt>
test   %rax,%rax
jle    1192 <main+0x52>
mov    %rax,%rbx
add    $0x1,%rbx
lea    0xe88(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1180 <main+0x40>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x3c,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"0x55,\00"
@.str.1 = [9 x i8] c"sleeping\00"
@stdout = global i32 0
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, 2
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strtol(i8* %12, i32* null, i32 0)
store i64 %13, i64* %6
br label %14
14: ; preds = %18, %9
%15 = load i64, i64* %6
%16 = add nsw i64 %15, -1
store i64 %16, i64* %6
%17 = icmp sgt i64 %15, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
20: ; preds = %14
store i32 0, i32* %3
br label %30
21: ; preds = %2
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %3
br label %30
25: ; preds = %21
%26 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = call i32 @fflush(i32 %27)
%29 = call i32 @sleep(i32 60)
store i32 %29, i32* %3
br label %30
30: ; preds = %25, %24, %20
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x55,\00"
@.str.1 = [9 x i8] c"sleeping\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %18 [
i32 2, label %3
i32 1, label %13
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i64 @strtol(i8* nocapture %5, i32* null, i32 0)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %3, %8
%9 = phi i64 [ %10, %8 ], [ %6, %3 ]
%10 = add nsw i64 %9, -1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = icmp ugt i64 %9, 1
br i1 %12, label %8, label %18
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @stdout
%16 = tail call i32 @fflush(i32 %15)
%17 = tail call i32 @sleep(i32 60)
br label %18
18: ; preds = %8, %3, %2, %13
%19 = phi i32 [ %17, %13 ], [ 1, %2 ], [ 0, %3 ], [ 0, %8 ]
ret i32 %19
}